Class: JSONAPI::ValueFormatter

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

Direct Known Subclasses

DefaultValueFormatter

Class Method Summary collapse

Methods inherited from Formatter

#formatter_for

Class Method Details

.format(raw_value, context) ⇒ Object



40
41
42
# File 'lib/jsonapi/formatter.rb', line 40

def format(raw_value, context)
  super(raw_value)
end

.unformat(value, context) ⇒ Object



44
45
46
# File 'lib/jsonapi/formatter.rb', line 44

def unformat(value, context)
  super(value)
end

.value_formatter_for(type) ⇒ Object



48
49
50
51
# File 'lib/jsonapi/formatter.rb', line 48

def value_formatter_for(type)
  formatter_name = "#{type.to_s.camelize}Value"
  formatter_for(formatter_name)
end