Module: JSONAPI::Attributes::ClassMethods
- Defined in:
- lib/jsonapi-serializers/attributes.rb
Instance Attribute Summary collapse
-
#attributes_map ⇒ Object
Returns the value of attribute attributes_map.
-
#to_many_associations ⇒ Object
Returns the value of attribute to_many_associations.
-
#to_one_associations ⇒ Object
Returns the value of attribute to_one_associations.
Instance Method Summary collapse
- #attribute(name, options = {}, &block) ⇒ Object
- #has_many(name, options = {}, &block) ⇒ Object
- #has_one(name, options = {}, &block) ⇒ Object
Instance Attribute Details
#attributes_map ⇒ Object
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_associations ⇒ Object
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_associations ⇒ Object
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, = {}, &block) add_attribute(name, , &block) end |
#has_many(name, options = {}, &block) ⇒ Object
24 25 26 |
# File 'lib/jsonapi-serializers/attributes.rb', line 24 def has_many(name, = {}, &block) add_to_many_association(name, , &block) end |
#has_one(name, options = {}, &block) ⇒ Object
20 21 22 |
# File 'lib/jsonapi-serializers/attributes.rb', line 20 def has_one(name, = {}, &block) add_to_one_association(name, , &block) end |