Class: ContentfulLite::BaseArray
- Inherits:
-
Delegator
- Object
- Delegator
- ContentfulLite::BaseArray
- Defined in:
- lib/contentful_lite/base_array.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#limit ⇒ Object
readonly
The maximum number of resources returned per request.
-
#skip ⇒ Object
readonly
The skip parameter sent to Contentful API for getting this result.
-
#total ⇒ Object
readonly
The total number of items in the result.
Instance Method Summary collapse
- #__getobj__ ⇒ Object private
- #__setobj__(value) ⇒ Object private
-
#initialize(raw) ⇒ BaseArray
constructor
private
A new instance of BaseArray.
Constructor Details
#initialize(raw) ⇒ BaseArray
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of BaseArray.
12 13 14 15 16 17 |
# File 'lib/contentful_lite/base_array.rb', line 12 def initialize(raw) @total = raw['total'] @skip = raw['skip'] @limit = raw['limit'] @items = raw.fetch('items', []) end |
Instance Attribute Details
#limit ⇒ Object (readonly)
The maximum number of resources returned per request
8 9 10 |
# File 'lib/contentful_lite/base_array.rb', line 8 def limit @limit end |
#skip ⇒ Object (readonly)
The skip parameter sent to Contentful API for getting this result
6 7 8 |
# File 'lib/contentful_lite/base_array.rb', line 6 def skip @skip end |
#total ⇒ Object (readonly)
The total number of items in the result
4 5 6 |
# File 'lib/contentful_lite/base_array.rb', line 4 def total @total end |
Instance Method Details
#__getobj__ ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 |
# File 'lib/contentful_lite/base_array.rb', line 20 def __getobj__ @items end |
#__setobj__(value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/contentful_lite/base_array.rb', line 25 def __setobj__(value) @items = value end |