Class: OnyxMesh::Page
- Inherits:
-
ResponseObject
- Object
- ResponseObject
- OnyxMesh::Page
- Includes:
- Enumerable
- Defined in:
- lib/onyx_mesh/page.rb
Instance Attribute Summary collapse
-
#cursor ⇒ String
readonly
String encoding the query object to request the next page of items.
-
#items ⇒ Array
readonly
List of items.
-
#last_page ⇒ Boolean
readonly
Indicator of whether there are more pages to load.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(raw_attribs, translate) ⇒ Page
constructor
A new instance of Page.
Methods inherited from ResponseObject
Constructor Details
#initialize(raw_attribs, translate) ⇒ Page
Returns a new instance of Page.
25 26 27 28 |
# File 'lib/onyx_mesh/page.rb', line 25 def initialize(raw_attribs, translate) super(raw_attribs) @items = (@items || []).map { |i| translate.call(i) } end |
Instance Attribute Details
#cursor ⇒ String (readonly)
String encoding the query object to request the next page of items.
18 |
# File 'lib/onyx_mesh/page.rb', line 18 attrib :cursor |
#items ⇒ Array (readonly)
List of items.
13 |
# File 'lib/onyx_mesh/page.rb', line 13 attrib :items |
#last_page ⇒ Boolean (readonly)
Indicator of whether there are more pages to load.
23 |
# File 'lib/onyx_mesh/page.rb', line 23 attrib :last_page |
Instance Method Details
#each ⇒ Object
30 31 32 33 34 |
# File 'lib/onyx_mesh/page.rb', line 30 def each @items.each do |item| yield item end end |