Class: Gloo::Verbs::Help
- Inherits:
-
Core::Verb
- Object
- Core::Baseo
- Core::Verb
- Gloo::Verbs::Help
- Defined in:
- lib/gloo/verbs/help.rb
Constant Summary collapse
- KEYWORD =
'help'.freeze
- KEYWORD_SHORT =
'?'.freeze
- DEFAULT_HELP =
'default_help'.freeze
- HELP_NOT_FOUND_ERR =
'Help command could not be found:'.freeze
- DISPATCH =
{ s: 'show_settings', settings: 'show_settings', verb: 'show_verbs', verbs: 'show_verbs', v: 'show_verbs', o: 'show_objs', obj: 'show_objs', object: 'show_objs', objects: 'show_objs' }.freeze
Constants inherited from Core::Baseo
Core::Baseo::NOT_IMPLEMENTED_ERR
Instance Attribute Summary
Attributes inherited from Core::Verb
Attributes inherited from Core::Baseo
Class Method Summary collapse
-
.keyword ⇒ Object
Get the Verb’s keyword.
-
.keyword_shortcut ⇒ Object
Get the Verb’s keyword shortcut.
Instance Method Summary collapse
-
#run ⇒ Object
Run the verb.
Methods inherited from Core::Verb
#display_value, help, inherited, #initialize, #type_display
Methods inherited from Core::Baseo
Constructor Details
This class inherits a constructor from Gloo::Core::Verb
Class Method Details
.keyword ⇒ Object
Get the Verb’s keyword.
45 46 47 |
# File 'lib/gloo/verbs/help.rb', line 45 def self.keyword return KEYWORD end |
.keyword_shortcut ⇒ Object
Get the Verb’s keyword shortcut.
52 53 54 |
# File 'lib/gloo/verbs/help.rb', line 52 def self.keyword_shortcut return KEYWORD_SHORT end |
Instance Method Details
#run ⇒ Object
Run the verb.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/gloo/verbs/help.rb', line 31 def run opts = @tokens.second if @tokens opts = opts.strip.downcase if opts if opts dispatch opts else show_default_help end end |