Class: Printavo::Page
- Inherits:
-
Struct
- Object
- Struct
- Printavo::Page
- Defined in:
- lib/printavo/page.rb
Overview
Wraps a single page of API results with cursor metadata.
Instance Attribute Summary collapse
-
#end_cursor ⇒ Object
Returns the value of attribute end_cursor.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#has_next_page ⇒ Object
Returns the value of attribute has_next_page.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#records ⇒ Object
Returns the value of attribute records.
Instance Method Summary collapse
Instance Attribute Details
#end_cursor ⇒ Object
Returns the value of attribute end_cursor
17 18 19 |
# File 'lib/printavo/page.rb', line 17 def end_cursor @end_cursor end |
#errors ⇒ Object
Returns the value of attribute errors
17 18 19 |
# File 'lib/printavo/page.rb', line 17 def errors @errors end |
#has_next_page ⇒ Object
Returns the value of attribute has_next_page
17 18 19 |
# File 'lib/printavo/page.rb', line 17 def has_next_page @has_next_page end |
#metadata ⇒ Object
Returns the value of attribute metadata
17 18 19 |
# File 'lib/printavo/page.rb', line 17 def @metadata end |
#records ⇒ Object
Returns the value of attribute records
17 18 19 |
# File 'lib/printavo/page.rb', line 17 def records @records end |
Instance Method Details
#empty? ⇒ Boolean
20 |
# File 'lib/printavo/page.rb', line 20 def empty? = records.empty? |
#partial? ⇒ Boolean
22 |
# File 'lib/printavo/page.rb', line 22 def partial? = records.any? && !success? |
#size ⇒ Object
19 |
# File 'lib/printavo/page.rb', line 19 def size = records.size |
#success? ⇒ Boolean
21 |
# File 'lib/printavo/page.rb', line 21 def success? = Array(errors).empty? |
#to_a ⇒ Object
18 |
# File 'lib/printavo/page.rb', line 18 def to_a = records |