Class: DefaultValueFormatter

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

Class Method Summary collapse

Methods inherited from JSONAPI::ValueFormatter

unformat, value_formatter_for

Methods inherited from JSONAPI::Formatter

#formatter_for, unformat

Class Method Details

.format(raw_value, context) ⇒ Object



85
86
87
88
89
90
91
92
# File 'lib/jsonapi/formatter.rb', line 85

def format(raw_value, context)
  case raw_value
    when String, Integer
      return raw_value
    else
      return raw_value.to_s
  end
end