Class: JSONAPI::ValueFormatter
- Defined in:
- lib/jsonapi/formatter.rb
Direct Known Subclasses
Class Method Summary collapse
- .format(raw_value, context) ⇒ Object
- .unformat(value, context) ⇒ Object
- .value_formatter_for(type) ⇒ Object
Methods inherited from Formatter
Class Method Details
.format(raw_value, context) ⇒ Object
42 43 44 |
# File 'lib/jsonapi/formatter.rb', line 42 def format(raw_value, context) super(raw_value) end |
.unformat(value, context) ⇒ Object
46 47 48 |
# File 'lib/jsonapi/formatter.rb', line 46 def unformat(value, context) super(value) end |
.value_formatter_for(type) ⇒ Object
50 51 52 53 |
# File 'lib/jsonapi/formatter.rb', line 50 def value_formatter_for(type) formatter_name = "#{type.to_s.camelize}Value" formatter_for(formatter_name) end |