Class: Swamp::CommandDSL
- Inherits:
-
Object
- Object
- Swamp::CommandDSL
- Defined in:
- lib/swamp/command_dsl.rb
Instance Method Summary collapse
- #action(&block) ⇒ Object
- #desc(text) ⇒ Object
-
#initialize(command) ⇒ CommandDSL
constructor
A new instance of CommandDSL.
- #option(*args, &block) ⇒ Object
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 |