Class: Swamp::CLIDSL
- Inherits:
-
Object
- Object
- Swamp::CLIDSL
- Defined in:
- lib/swamp/cli_dsl.rb
Instance Method Summary collapse
- #command(name, &block) ⇒ Object
-
#initialize(cli) ⇒ CLIDSL
constructor
A new instance of CLIDSL.
Constructor Details
#initialize(cli) ⇒ CLIDSL
Returns a new instance of CLIDSL.
7 8 9 |
# File 'lib/swamp/cli_dsl.rb', line 7 def initialize(cli) @cli = cli end |
Instance Method Details
#command(name, &block) ⇒ Object
11 12 13 14 15 |
# File 'lib/swamp/cli_dsl.rb', line 11 def command(name, &block) command = Command.new(@cli, name) CommandDSL.new(command).instance_eval(&block) @cli.add(command) end |