Class: HammerCLI::Help::List
- Inherits:
-
AbstractItem
- Object
- AbstractItem
- HammerCLI::Help::List
- Defined in:
- lib/hammer_cli/help/definition/list.rb
Constant Summary collapse
- LIST_INDENT =
20
Constants inherited from AbstractItem
Instance Attribute Summary
Attributes inherited from AbstractItem
Instance Method Summary collapse
- #build_string ⇒ Object
-
#initialize(items, options = {}) ⇒ List
constructor
A new instance of List.
Methods inherited from AbstractItem
Constructor Details
#initialize(items, options = {}) ⇒ List
Returns a new instance of List.
6 7 8 9 10 |
# File 'lib/hammer_cli/help/definition/list.rb', line 6 def initialize(items, = {}) super() @indent_size = [:indent_size] || indent_size(items) build_definition(items || []) end |
Instance Method Details
#build_string ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/hammer_cli/help/definition/list.rb', line 12 def build_string out = StringIO.new @definition.each do |item| out.puts item.build_string end out.string end |