Class: Ivy::Serializers::Documents::IndividualResource

Inherits:
Document
  • Object
show all
Defined in:
lib/ivy/serializers/documents/individual_resource.rb

Instance Method Summary collapse

Methods inherited from Document

#belongs_to, #generate, #generate_attributes, #generate_included_resources, #generate_relationships, #generate_resource, #has_many, #initialize

Constructor Details

This class inherits a constructor from Ivy::Serializers::Documents::Document

Instance Method Details

#generate_included(generator) ⇒ Object



7
8
9
10
# File 'lib/ivy/serializers/documents/individual_resource.rb', line 7

def generate_included(generator)
  @serializer.relationships(self, @primary_resource)
  super
end

#generate_primary_resource(generator) ⇒ Object



12
13
14
# File 'lib/ivy/serializers/documents/individual_resource.rb', line 12

def generate_primary_resource(generator)
  generator.primary_resource(@primary_resource_name, @primary_resource)
end