Module: ActiveModel::Serializer::Type::ClassMethods

Defined in:
lib/active_model/serializer/concerns/type.rb

Instance Method Summary collapse

Instance Method Details

#type(type) ⇒ Object

Set the JSON API type of a serializer.

Examples:

class AdminAuthorSerializer < ActiveModel::Serializer
  type 'authors'


19
20
21
# File 'lib/active_model/serializer/concerns/type.rb', line 19

def type(type)
  self._type = type && type.to_s
end