class ApiView::Default

Public Class Methods

convert(obj) click to toggle source
# File lib/api_view/default.rb, line 3
def self.convert(obj)
  if obj.respond_to? :to_api then
    obj.to_api
  elsif obj.respond_to? :to_hash then
    obj.to_hash
  elsif obj.respond_to? :serializable_hash then
    obj.serializable_hash
  else
    obj
  end
end

Public Instance Methods

convert() click to toggle source

delegate to class method

# File lib/api_view/default.rb, line 16
def convert
  self.class.convert(object)
end