Class: HammerCLI::Help::Text

Inherits:
AbstractItem show all
Defined in:
lib/hammer_cli/help/definition/text.rb

Direct Known Subclasses

Note

Constant Summary

Constants inherited from AbstractItem

AbstractItem::INDENT_STEP

Instance Attribute Summary

Attributes inherited from AbstractItem

#definition, #id, #richtext

Instance Method Summary collapse

Methods inherited from AbstractItem

indent

Constructor Details

#initialize(text = nil, options = {}) ⇒ Text

Returns a new instance of Text.



4
5
6
7
# File 'lib/hammer_cli/help/definition/text.rb', line 4

def initialize(text = nil, options = {})
  super(options)
  build_definition(text)
end

Instance Method Details

#build_stringObject



9
10
11
12
13
# File 'lib/hammer_cli/help/definition/text.rb', line 9

def build_string
  text = @text
  text = HighLine.color(@text, :bold) if @richtext
  text
end