Class: Clashinator::ArrayResource
- Inherits:
-
Object
- Object
- Clashinator::ArrayResource
- Defined in:
- lib/clashinator/array_resource.rb
Overview
This class represents the array resource model This is only for array-based responses that contains an items attribute and a paging attribute
Defined Under Namespace
Classes: Cursor
Instance Attribute Summary collapse
-
#items ⇒ Object
Returns the value of attribute items.
-
#model ⇒ Object
Returns the value of attribute model.
-
#paging ⇒ Object
Returns the value of attribute paging.
Instance Method Summary collapse
-
#initialize(model, items, paging = { 'cursors' => {} }) ⇒ ArrayResource
constructor
A new instance of ArrayResource.
Constructor Details
#initialize(model, items, paging = { 'cursors' => {} }) ⇒ ArrayResource
Returns a new instance of ArrayResource.
9 10 11 12 13 14 15 |
# File 'lib/clashinator/array_resource.rb', line 9 def initialize(model, items, paging = { 'cursors' => {} }) @model = model @items = as_array_of_model(items) @paging = Clashinator::ArrayResource::Cursor.new( paging['cursors'] ) end |
Instance Attribute Details
#items ⇒ Object
Returns the value of attribute items.
7 8 9 |
# File 'lib/clashinator/array_resource.rb', line 7 def items @items end |
#model ⇒ Object
Returns the value of attribute model.
7 8 9 |
# File 'lib/clashinator/array_resource.rb', line 7 def model @model end |
#paging ⇒ Object
Returns the value of attribute paging.
7 8 9 |
# File 'lib/clashinator/array_resource.rb', line 7 def paging @paging end |