Class: JSONAPI::Formatter

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

Direct Known Subclasses

KeyFormatter, RouteFormatter, ValueFormatter

Class Method Summary collapse

Class Method Details

.cachedObject



14
15
16
# File 'lib/jsonapi/formatter.rb', line 14

def cached
  return FormatterWrapperCache.new(self)
end

.format(arg) ⇒ Object



6
7
8
# File 'lib/jsonapi/formatter.rb', line 6

def format(arg)
  arg.to_s
end

.formatter_for(format) ⇒ Object



22
23
24
# File 'lib/jsonapi/formatter.rb', line 22

def formatter_for(format)
  "#{format.to_s.camelize}Formatter".safe_constantize
end

.uncachedObject



18
19
20
# File 'lib/jsonapi/formatter.rb', line 18

def uncached
  return self
end

.unformat(arg) ⇒ Object



10
11
12
# File 'lib/jsonapi/formatter.rb', line 10

def unformat(arg)
  arg
end