Class: Orchparty::CommonBuilder
Instance Method Summary
collapse
Methods inherited from Builder
#assign_or_merge, build
Constructor Details
Returns a new instance of CommonBuilder.
181
182
183
|
# File 'lib/orchparty/dsl_parser.rb', line 181
def initialize(node)
@node = node
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *values, &block) ⇒ Object
189
190
191
192
193
194
195
|
# File 'lib/orchparty/dsl_parser.rb', line 189
def method_missing(name, *values, &block)
if block_given?
assign_or_merge(@node, name, HashBuilder.build(block))
else
assign_or_merge(@node, name, values.first)
end
end
|
Instance Method Details
#_build ⇒ Object
197
198
199
|
# File 'lib/orchparty/dsl_parser.rb', line 197
def _build
@node
end
|
#mix(name) ⇒ Object
185
186
187
|
# File 'lib/orchparty/dsl_parser.rb', line 185
def mix(name)
@node._mix << name
end
|
#variables(&block) ⇒ Object
201
202
203
204
205
|
# File 'lib/orchparty/dsl_parser.rb', line 201
def variables(&block)
@node._variables ||= {}
@node._variables = @node._variables.merge(VariableBuilder.build(block))
self
end
|