Class: HammerCLI::Output::Formatters::KeyValueFormatter

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

Instance Method Summary collapse

Methods inherited from FieldFormatter

#match?

Instance Method Details

#format(params, field_params = {}) ⇒ Object



118
119
120
121
122
123
124
125
126
# File 'lib/hammer_cli/output/formatters.rb', line 118

def format(params, field_params={})
  if params.is_a? Hash
    name = params[:name] || params["name"]
    value = params[:value] || params["value"]
    "#{name} => #{value}"
  else
    ""
  end
end

#tagsObject



114
115
116
# File 'lib/hammer_cli/output/formatters.rb', line 114

def tags
  [:screen, :flat]
end