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



124
125
126
127
128
129
130
131
132
# File 'lib/hammer_cli/output/formatters.rb', line 124

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



120
121
122
# File 'lib/hammer_cli/output/formatters.rb', line 120

def tags
  [:screen, :flat]
end