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
74 75 76 |
# File 'lib/seam/paginator.rb', line 74 def has_next_page @has_next_page end |
#next_page_cursor ⇒ Object
Returns the value of attribute next_page_cursor
74 75 76 |
# File 'lib/seam/paginator.rb', line 74 def next_page_cursor @next_page_cursor end |
#next_page_url ⇒ Object
Returns the value of attribute next_page_url
74 75 76 |
# File 'lib/seam/paginator.rb', line 74 def next_page_url @next_page_url end |
Class Method Details
.from_hash(hash) ⇒ Object
75 76 77 78 79 80 81 82 83 |
# File 'lib/seam/paginator.rb', line 75 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
85 86 87 |
# File 'lib/seam/paginator.rb', line 85 def has_next_page? has_next_page == true end |