Class: HammerCLI::Output::Formatters::BooleanFormatter

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(value, field_params = {}) ⇒ Object



210
211
212
# File 'lib/hammer_cli/output/formatters.rb', line 210

def format(value, field_params={})
  (value == 0 || !value || value == "") ? _("no") : _("yes")
end

#required_featuresObject



204
205
206
207
208
# File 'lib/hammer_cli/output/formatters.rb', line 204

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

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