Class: RGen::ModelBuilder::BuilderContext::ConstPathElement
- Inherits:
-
Module
- Object
- Module
- RGen::ModelBuilder::BuilderContext::ConstPathElement
show all
- Defined in:
- lib/rgen/model_builder/builder_context.rb
Instance Method Summary
collapse
Constructor Details
#initialize(name, builderContext, parent = nil) ⇒ ConstPathElement
Returns a new instance of ConstPathElement.
183
184
185
186
187
|
# File 'lib/rgen/model_builder/builder_context.rb', line 183
def initialize(name, builderContext, parent=nil)
@name = name.to_s
@builderContext = builderContext
@parent = parent
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
193
194
195
196
197
|
# File 'lib/rgen/model_builder/builder_context.rb', line 193
def method_missing(m, *args, &block)
@builderContext._using(self) do
send(m, *args, &block)
end
end
|
Instance Method Details
#const_missing(const) ⇒ Object
189
190
191
|
# File 'lib/rgen/model_builder/builder_context.rb', line 189
def const_missing(const)
ConstPathElement.new(const, @builderContext, self)
end
|
#constPath ⇒ Object
199
200
201
202
203
204
205
|
# File 'lib/rgen/model_builder/builder_context.rb', line 199
def constPath
if @parent
@parent.constPath << @name
else
[@name]
end
end
|