Class: JSONAPI::Consumer::KeyFormatter

Inherits:
Formatter
  • Object
show all
Defined in:
lib/jsonapi/consumer/formatter.rb

Class Method Summary collapse

Methods inherited from Formatter

formatter_for

Class Method Details

.format(key) ⇒ Object



25
26
27
# File 'lib/jsonapi/consumer/formatter.rb', line 25

def format(key)
  super
end

.format_keys(hash) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/jsonapi/consumer/formatter.rb', line 29

def format_keys(hash)
  Hash[
    hash.map do |key, value|
      [format(key).to_sym, value]
    end
  ]
end

.unformat(formatted_key) ⇒ Object



37
38
39
# File 'lib/jsonapi/consumer/formatter.rb', line 37

def unformat(formatted_key)
  super
end