Module: Pione::Command::CommandActionInterface
- Included in:
- CommonCommandAction
- Defined in:
- lib/pione/command/basic-command.rb
Class Method Summary collapse
Instance Method Summary collapse
- #define_action(name, &b) ⇒ Object
-
#get(name) ⇒ Object
Return the named action.
Class Method Details
.extended(mod) ⇒ Object
337 338 339 |
# File 'lib/pione/command/basic-command.rb', line 337 def extended(mod) mod.instance_variable_set(:@action, Hash.new) end |
Instance Method Details
#define_action(name, &b) ⇒ Object
347 348 349 |
# File 'lib/pione/command/basic-command.rb', line 347 def define_action(name, &b) @action[name] = b end |
#get(name) ⇒ Object
Return the named action.
343 344 345 |
# File 'lib/pione/command/basic-command.rb', line 343 def get(name) @action[name] || (raise ActionNotFound.new(self, name)) end |