Class: JSONAPI::Consumer::Formatter
- Inherits:
-
Object
- Object
- JSONAPI::Consumer::Formatter
show all
- Defined in:
- lib/jsonapi/consumer/formatter.rb
Class Method Summary
collapse
Class Method Details
8
9
10
|
# File 'lib/jsonapi/consumer/formatter.rb', line 8
def format(arg)
arg.to_s
end
|
18
19
20
21
|
# File 'lib/jsonapi/consumer/formatter.rb', line 18
def formatter_for(format)
formatter_class_name = "JSONAPI::Consumer::#{format.to_s.camelize}Formatter"
formatter_class_name.safe_constantize
end
|
12
13
14
15
16
|
# File 'lib/jsonapi/consumer/formatter.rb', line 12
def unformat(arg)
arg.to_s
end
|