Class: JSONAPI::Document::Resource::Attributes
- Inherits:
-
NameValuePairCollection
- Object
- Collection
- NameValuePairCollection
- JSONAPI::Document::Resource::Attributes
- Defined in:
- lib/easy/jsonapi/document/resource/attributes.rb,
lib/easy/jsonapi/document/resource/attributes/attribute.rb
Overview
The attributes of a resource
Defined Under Namespace
Classes: Attribute
Instance Method Summary collapse
-
#add(attribute) ⇒ Object
Add a jsonapi member to the collection.
-
#initialize(attr_arr = []) ⇒ Attributes
constructor
A new instance of Attributes.
Methods inherited from NameValuePairCollection
Methods inherited from Collection
#[], #[]=, #each, #empty?, #get, #include?, #insert, #keys, #remove, #set, #size, #to_s
Constructor Details
#initialize(attr_arr = []) ⇒ Attributes
Returns a new instance of Attributes.
14 15 16 |
# File 'lib/easy/jsonapi/document/resource/attributes.rb', line 14 def initialize(attr_arr = []) super(attr_arr, item_type: JSONAPI::Document::Resource::Attributes::Attribute) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class JSONAPI::NameValuePairCollection
Instance Method Details
#add(attribute) ⇒ Object
Add a jsonapi member to the collection
20 21 22 |
# File 'lib/easy/jsonapi/document/resource/attributes.rb', line 20 def add(attribute) super(attribute, &:name) end |