Class: HammerCLI::Output::Formatters::InlineTextFormatter

Inherits:
FieldFormatter
  • Object
show all
Defined in:
lib/hammer_cli/output/formatters.rb

Instance Method Summary collapse

Methods inherited from FieldFormatter

inherited, #match?, #tags

Instance Method Details

#format(text, _field_params = {}) ⇒ Object



179
180
181
# File 'lib/hammer_cli/output/formatters.rb', line 179

def format(text, _field_params = {})
  text.to_s.tr("\r\n", ' ')
end

#required_featuresObject



173
174
175
176
177
# File 'lib/hammer_cli/output/formatters.rb', line 173

def required_features
  return %i[serialized inline] if tags.empty?

  tags.map { |t| HammerCLI::Output::Utils.tag_to_feature(t) }
end