class SimpleJsonapi::Serializer

Subclass {Serializer} to create serializers for specific types of resources.

Public Class Methods

attribute(name, **options, &block) click to toggle source

@overload (see Definition::Resource#id) @return (see Definition::Resource#id) @overload attribute(name, options = {}) @overload attribute(name, options = {}, &block) @return (see Definition::Resource#attribute)

# File lib/simple_jsonapi/serializer.rb, line 23
def attribute(name, **options, &block)
  definition.attribute(name, **options, &block)
end
has_many(name, **options, &block) click to toggle source

@overload (see Definition::Resource#has_many) @param (see Definition::Resource#has_many) @yieldparam (see Definition::Resource#has_many) @yieldreturn (see Definition::Resource#has_many) @return (see Definition::Resource#has_many)

# File lib/simple_jsonapi/serializer.rb, line 41
def has_many(name, **options, &block)
  definition.has_many(name, **options, &block)
end
has_one(name, **options, &block) click to toggle source

@overload (see Definition::Resource#has_one) @param (see Definition::Resource#has_one) @yieldparam (see Definition::Resource#has_one) @yieldreturn (see Definition::Resource#has_one) @return (see Definition::Resource#has_one)

# File lib/simple_jsonapi/serializer.rb, line 32
def has_one(name, **options, &block)
  definition.has_one(name, **options, &block)
end
id(*args, &block) click to toggle source

@overload (see Definition::Resource#id) @return (see Definition::Resource#id)

# File lib/simple_jsonapi/serializer.rb, line 8
def id(*args, &block)
  definition.id(*args, &block)
end
meta(name, *args, **options, &block) click to toggle source

@overload (see Definition::Concerns::HasMetaObject#meta) @return (see Definition::Concerns::HasMetaObject#meta)

# File lib/simple_jsonapi/serializer.rb, line 53
def meta(name, *args, **options, &block)
  definition.meta(name, *args, **options, &block)
end
type(*args, &block) click to toggle source

@overload (see Definition::Resource#type) @return (see Definition::Resource#type)

# File lib/simple_jsonapi/serializer.rb, line 14
def type(*args, &block)
  definition.type(*args, &block)
end

Public Instance Methods

attribute_definitions() click to toggle source

@return (see Definition::Resource#attribute_definitions)

# File lib/simple_jsonapi/serializer.rb, line 71
def attribute_definitions
  definition.attribute_definitions
end
id_definition() click to toggle source

@return (see Definition::Resource#id_definition)

# File lib/simple_jsonapi/serializer.rb, line 61
def id_definition
  definition.id_definition
end
meta_definitions() click to toggle source

@return (see Definition::Concerns::HasMetaObject#meta_definitions)

# File lib/simple_jsonapi/serializer.rb, line 86
def meta_definitions
  definition.meta_definitions
end
relationship_definitions() click to toggle source

@return (see Definition::Resource#relationship_definitions)

# File lib/simple_jsonapi/serializer.rb, line 76
def relationship_definitions
  definition.relationship_definitions
end
type_definition() click to toggle source

@return (see Definition::Resource#type_definition)

# File lib/simple_jsonapi/serializer.rb, line 66
def type_definition
  definition.type_definition
end