Class: HammerCLI::Output::Formatters::LongTextFormatter
- Inherits:
-
FieldFormatter
- Object
- FieldFormatter
- HammerCLI::Output::Formatters::LongTextFormatter
- Defined in:
- lib/hammer_cli/output/formatters.rb
Constant Summary collapse
- INDENT =
" "
Instance Method Summary collapse
- #format(text, field_params = {}) ⇒ Object
-
#initialize(options = {}) ⇒ LongTextFormatter
constructor
A new instance of LongTextFormatter.
- #tags ⇒ Object
Methods inherited from FieldFormatter
Constructor Details
#initialize(options = {}) ⇒ LongTextFormatter
Returns a new instance of LongTextFormatter.
133 134 135 |
# File 'lib/hammer_cli/output/formatters.rb', line 133 def initialize( = {}) @indent = [:indent].nil? ? true : [:indent] end |
Instance Method Details
#format(text, field_params = {}) ⇒ Object
141 142 143 144 |
# File 'lib/hammer_cli/output/formatters.rb', line 141 def format(text, field_params={}) text = text.to_s.indent_with(INDENT) if @indent "\n#{text}" end |
#tags ⇒ Object
137 138 139 |
# File 'lib/hammer_cli/output/formatters.rb', line 137 def [:screen] end |