module Served::Resource::Serializable

Public Instance Methods

dump() click to toggle source
# File lib/served/resource/serializable.rb, line 93
def dump
  if respond_to?(:presenter)
    warn 'DEPRECATION WARNING: using presenters is deprecated and will be removed in served 1.0'
    return presenter.to_json
  end
  self.class.serializer.dump(self, attributes)
end
load(string) click to toggle source
# File lib/served/resource/serializable.rb, line 101
def load(string)
  self.class.serializer.load(string)
end
to_json(*_args) click to toggle source
# File lib/served/resource/serializable.rb, line 89
def to_json(*_args)
  dump
end