Class: HammerCLI::Output::Formatters::LongTextFormatter
Constant Summary
collapse
- INDENT =
" "
Instance Method Summary
collapse
inherited, #match?, #tags
Constructor Details
Returns a new instance of LongTextFormatter.
156
157
158
|
# File 'lib/hammer_cli/output/formatters.rb', line 156
def initialize(options = {})
@indent = options[:indent].nil? ? true : options[:indent]
end
|
Instance Method Details
166
167
168
169
|
# File 'lib/hammer_cli/output/formatters.rb', line 166
def format(text, field_params={})
text = text.to_s.indent_with(INDENT) if @indent
"\n#{text}"
end
|
#required_features ⇒ Object
160
161
162
163
164
|
# File 'lib/hammer_cli/output/formatters.rb', line 160
def required_features
return %i[rich_text] if tags.empty?
tags.map { |t| HammerCLI::Output::Utils.tag_to_feature(t) }
end
|