Class: Mercenary::Presenter
- Inherits:
-
Object
- Object
- Mercenary::Presenter
- Defined in:
- lib/patches/mercenary_presenter.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
Instance Method Summary collapse
- #command_header ⇒ Object
-
#command_options_presentation ⇒ Object
adapted from github.com/jekyll/mercenary/pull/44.
- #options_presentation ⇒ Object
- #parent_command_options_presentation ⇒ Object
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
3 4 5 |
# File 'lib/patches/mercenary_presenter.rb', line 3 def command @command end |
Instance Method Details
#command_header ⇒ Object
23 24 25 26 27 |
# File 'lib/patches/mercenary_presenter.rb', line 23 def command_header header = "\n#{command.identity}" header << " -- #{command.description}" if command.description header end |
#command_options_presentation ⇒ Object
adapted from github.com/jekyll/mercenary/pull/44
16 17 18 19 20 21 |
# File 'lib/patches/mercenary_presenter.rb', line 16 def return nil if command..empty? = command. -= command.parent. unless command.parent.nil? .map(&:to_s).join("\n") end |
#options_presentation ⇒ Object
5 6 7 8 |
# File 'lib/patches/mercenary_presenter.rb', line 5 def return nil unless || [.cyan, ].join("\n\n").rstrip end |
#parent_command_options_presentation ⇒ Object
10 11 12 13 |
# File 'lib/patches/mercenary_presenter.rb', line 10 def return nil unless command.parent Presenter.new(command.parent). end |