Class: Swamp::CLIDSL

Inherits:
Object
  • Object
show all
Defined in:
lib/swamp/cli_dsl.rb

Instance Method Summary collapse

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