Class: HammerCLI::Help::Section
- Inherits:
-
AbstractItem
- Object
- AbstractItem
- HammerCLI::Help::Section
- Defined in:
- lib/hammer_cli/help/definition/section.rb
Constant Summary
Constants inherited from AbstractItem
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Attributes inherited from AbstractItem
Instance Method Summary collapse
- #build_string ⇒ Object
-
#initialize(label, definition = nil, options = {}) ⇒ Section
constructor
A new instance of Section.
Methods inherited from AbstractItem
Constructor Details
#initialize(label, definition = nil, options = {}) ⇒ Section
Returns a new instance of Section.
6 7 8 9 10 11 |
# File 'lib/hammer_cli/help/definition/section.rb', line 6 def initialize(label, definition = nil, = {}) super() @label = label @id ||= label build_definition(definition) end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
4 5 6 |
# File 'lib/hammer_cli/help/definition/section.rb', line 4 def label @label end |
Instance Method Details
#build_string ⇒ Object
13 14 15 16 17 18 |
# File 'lib/hammer_cli/help/definition/section.rb', line 13 def build_string out = StringIO.new out.puts heading out.puts indent(@definition.build_string) out.string end |