Class: Ergane::HelpFormatter
Instance Attribute Summary collapse
-
#command_class ⇒ Object
readonly
Returns the value of attribute command_class.
-
#command_path ⇒ Object
readonly
Returns the value of attribute command_path.
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(command_class, command_path: []) ⇒ HelpFormatter
constructor
A new instance of HelpFormatter.
Constructor Details
#initialize(command_class, command_path: []) ⇒ HelpFormatter
Returns a new instance of HelpFormatter.
7 8 9 10 |
# File 'lib/ergane/help_formatter.rb', line 7 def initialize(command_class, command_path: []) @command_class = command_class @command_path = command_path end |
Instance Attribute Details
#command_class ⇒ Object (readonly)
Returns the value of attribute command_class.
5 6 7 |
# File 'lib/ergane/help_formatter.rb', line 5 def command_class @command_class end |
#command_path ⇒ Object (readonly)
Returns the value of attribute command_path.
5 6 7 |
# File 'lib/ergane/help_formatter.rb', line 5 def command_path @command_path end |
Instance Method Details
#format ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ergane/help_formatter.rb', line 12 def format [ description_section, version_section, usage_section, subcommands_section, , arguments_section ].compact.join("\n\n") + "\n" end |