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