Class: McBlocky::DSL::PartialCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/mcblocky/dsl/commands.rb

Instance Method Summary collapse

Constructor Details

#initialize(context, *args) ⇒ PartialCommand

Returns a new instance of PartialCommand.



162
163
164
165
166
167
168
169
# File 'lib/mcblocky/dsl/commands.rb', line 162

def initialize(context, *args)
  @context = context
  @args = args
  @a = Selector.new '@a'
  @p = Selector.new '@p'
  @r = Selector.new '@r'
  @e = Selector.new '@e'
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object



171
172
173
# File 'lib/mcblocky/dsl/commands.rb', line 171

def method_missing(m, *args)
  @context.command *(@args + [m] + args)
end