Class: Scale::DSLCommand

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

Instance Method Summary collapse

Constructor Details

#initialize(name, args, block) ⇒ DSLCommand



11
12
13
14
15
# File 'lib/scale/dsl.rb', line 11

def initialize(name, args, block)
  @name = name
  @args = args
  @block = block
end

Instance Method Details

#run(svg) ⇒ Object



17
18
19
20
# File 'lib/scale/dsl.rb', line 17

def run(svg)
  type = Kernel.const_get("Scale::#{@name.to_s.capitalize}")
  svg.add(type.new(*@args))
end