Class: Scale::DSLCommand
- Inherits:
-
Object
- Object
- Scale::DSLCommand
- Defined in:
- lib/scale/dsl.rb
Instance Method Summary collapse
-
#initialize(name, args, block) ⇒ DSLCommand
constructor
A new instance of DSLCommand.
- #run(svg) ⇒ Object
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 |