Class: Steamd::Generator::GeneratedClass
- Inherits:
-
Object
- Object
- Steamd::Generator::GeneratedClass
- Defined in:
- lib/steamd/generator/generated_class.rb
Overview
Represents an Class from the Generator
Instance Method Summary collapse
-
#constants ⇒ Object
List of constants to be used in the class.
-
#erb_binding ⇒ Object
Binding for ERB.
-
#initialize(klass) ⇒ GeneratedClass
constructor
Create a Generated Class.
-
#name ⇒ Object
The class name.
-
#variables ⇒ Object
List of variables to be used in the class.
Constructor Details
#initialize(klass) ⇒ GeneratedClass
Create a Generated Class
99 100 101 |
# File 'lib/steamd/generator/generated_class.rb', line 99 def initialize(klass) @klass = klass end |
Instance Method Details
#constants ⇒ Object
List of constants to be used in the class
111 112 113 114 115 |
# File 'lib/steamd/generator/generated_class.rb', line 111 def constants @klass[:variables].select { |v| v[:modifier] == 'const' }.map do |const| Constant.new(const) end end |
#erb_binding ⇒ Object
Binding for ERB
123 124 125 |
# File 'lib/steamd/generator/generated_class.rb', line 123 def erb_binding binding end |
#name ⇒ Object
The class name
118 119 120 |
# File 'lib/steamd/generator/generated_class.rb', line 118 def name @klass[:name] end |