Module: ThreeScaleToolbox::Command::ClassMethods
- Defined in:
- lib/3scale_toolbox/base_command.rb
Instance Method Summary collapse
- #add_subcommand(command) ⇒ Object
-
#build_command ⇒ Object
Iterate recursively over command tree.
-
#command ⇒ Object
Override to command.
- #subcommands ⇒ Object
Instance Method Details
#add_subcommand(command) ⇒ Object
12 13 14 |
# File 'lib/3scale_toolbox/base_command.rb', line 12 def add_subcommand(command) subcommands << command end |
#build_command ⇒ Object
Iterate recursively over command tree
26 27 28 29 30 |
# File 'lib/3scale_toolbox/base_command.rb', line 26 def build_command subcommands.each_with_object(command) do |subcommand, root_command| root_command.add_command(subcommand.build_command) end end |
#command ⇒ Object
Override to command
19 20 21 |
# File 'lib/3scale_toolbox/base_command.rb', line 19 def command raise Exception, 'base command has no command definition' end |
#subcommands ⇒ Object
8 9 10 |
# File 'lib/3scale_toolbox/base_command.rb', line 8 def subcommands @subcommands ||= [] end |