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.
139 140 141 |
# File 'lib/hammer_cli/output/formatters.rb', line 139 def initialize( = {}) @indent = [:indent].nil? ? true : [:indent] end |
Instance Method Details
#format(text, field_params = {}) ⇒ Object
147 148 149 150 |
# File 'lib/hammer_cli/output/formatters.rb', line 147 def format(text, field_params={}) text = text.to_s.indent_with(INDENT) if @indent "\n#{text}" end |
#tags ⇒ Object
143 144 145 |
# File 'lib/hammer_cli/output/formatters.rb', line 143 def [:screen] end |