Class: Twigg::Command::Help
- Inherits:
-
Twigg::Command
- Object
- Twigg::Command
- Twigg::Command::Help
- Defined in:
- lib/twigg/command/help.rb
Constant Summary collapse
- PUBLIC_HELP_TOPICS =
PUBLIC_SUBCOMMANDS + %w[commands usage]
- HELP_TOPICS =
PUBLIC_HELP_TOPICS + EASTER_EGGS
Constants inherited from Twigg::Command
EASTER_EGGS, PUBLIC_SUBCOMMANDS, SUBCOMMANDS
Instance Method Summary collapse
-
#initialize(*args) ⇒ Help
constructor
A new instance of Help.
- #run ⇒ Object
Methods inherited from Twigg::Command
Constructor Details
#initialize(*args) ⇒ Help
Returns a new instance of Help.
7 8 9 10 11 |
# File 'lib/twigg/command/help.rb', line 7 def initialize(*args) super @topic = @args.shift ignore @args end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/twigg/command/help.rb', line 13 def run if HELP_TOPICS.include?(@topic) show_help(@topic) else PUBLIC_HELP_TOPICS.each { |topic| show_help(topic) } end end |