Class: Swamp::CommandDSL

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

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ CommandDSL

Returns a new instance of CommandDSL.



4
5
6
# File 'lib/swamp/command_dsl.rb', line 4

def initialize(command)
  @command = command
end

Instance Method Details

#action(&block) ⇒ Object



8
9
10
# File 'lib/swamp/command_dsl.rb', line 8

def action(&block)
  @command.set_action(&block)
end

#desc(text) ⇒ Object



16
17
18
# File 'lib/swamp/command_dsl.rb', line 16

def desc(text)
  @command.description = text
end

#option(*args, &block) ⇒ Object



12
13
14
# File 'lib/swamp/command_dsl.rb', line 12

def option(*args, &block)
  @command.add_option(*args, &block)
end