Module: JSONAPI::Attributes::ClassMethods

Defined in:
lib/jsonapi-serializers/attributes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attributes_mapObject

Returns the value of attribute attributes_map.



12
13
14
# File 'lib/jsonapi-serializers/attributes.rb', line 12

def attributes_map
  @attributes_map
end

#to_many_associationsObject

Returns the value of attribute to_many_associations.



14
15
16
# File 'lib/jsonapi-serializers/attributes.rb', line 14

def to_many_associations
  @to_many_associations
end

#to_one_associationsObject

Returns the value of attribute to_one_associations.



13
14
15
# File 'lib/jsonapi-serializers/attributes.rb', line 13

def to_one_associations
  @to_one_associations
end

Instance Method Details

#attribute(name, options = {}, &block) ⇒ Object



16
17
18
# File 'lib/jsonapi-serializers/attributes.rb', line 16

def attribute(name, options = {}, &block)
  add_attribute(name, options, &block)
end

#has_many(name, options = {}, &block) ⇒ Object



24
25
26
# File 'lib/jsonapi-serializers/attributes.rb', line 24

def has_many(name, options = {}, &block)
  add_to_many_association(name, options, &block)
end

#has_one(name, options = {}, &block) ⇒ Object



20
21
22
# File 'lib/jsonapi-serializers/attributes.rb', line 20

def has_one(name, options = {}, &block)
  add_to_one_association(name, options, &block)
end