Class: Seam::Pagination
- Inherits:
-
Struct
- Object
- Struct
- Seam::Pagination
- Defined in:
- lib/seam/paginator.rb
Instance Attribute Summary collapse
-
#has_next_page ⇒ Object
Returns the value of attribute has_next_page.
-
#next_page_cursor ⇒ Object
Returns the value of attribute next_page_cursor.
-
#next_page_url ⇒ Object
Returns the value of attribute next_page_url.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#has_next_page ⇒ Object
Returns the value of attribute has_next_page
77 78 79 |
# File 'lib/seam/paginator.rb', line 77 def has_next_page @has_next_page end |
#next_page_cursor ⇒ Object
Returns the value of attribute next_page_cursor
77 78 79 |
# File 'lib/seam/paginator.rb', line 77 def next_page_cursor @next_page_cursor end |
#next_page_url ⇒ Object
Returns the value of attribute next_page_url
77 78 79 |
# File 'lib/seam/paginator.rb', line 77 def next_page_url @next_page_url end |
Class Method Details
.from_hash(hash) ⇒ Object
78 79 80 81 82 83 84 85 86 |
# File 'lib/seam/paginator.rb', line 78 def self.from_hash(hash) return nil unless hash.is_a?(Hash) && !hash.empty? new( has_next_page: hash.fetch("has_next_page", false), next_page_cursor: hash.fetch("next_page_cursor", nil), next_page_url: hash.fetch("next_page_url", nil) ) end |
Instance Method Details
#has_next_page? ⇒ Boolean
88 89 90 |
# File 'lib/seam/paginator.rb', line 88 def has_next_page? has_next_page == true end |