Class: ShopifyAPI::PaginationLinkHeaders
- Inherits:
-
Object
- Object
- ShopifyAPI::PaginationLinkHeaders
- Defined in:
- lib/shopify_api/pagination_link_headers.rb
Defined Under Namespace
Classes: LinkHeader
Instance Attribute Summary collapse
-
#next_link ⇒ Object
readonly
Returns the value of attribute next_link.
-
#previous_link ⇒ Object
readonly
Returns the value of attribute previous_link.
Instance Method Summary collapse
-
#initialize(link_header) ⇒ PaginationLinkHeaders
constructor
A new instance of PaginationLinkHeaders.
Constructor Details
#initialize(link_header) ⇒ PaginationLinkHeaders
Returns a new instance of PaginationLinkHeaders.
9 10 11 12 13 |
# File 'lib/shopify_api/pagination_link_headers.rb', line 9 def initialize(link_header) links = parse_link_header(link_header) @previous_link = links.find { |link| link.rel == :previous } @next_link = links.find { |link| link.rel == :next } end |
Instance Attribute Details
#next_link ⇒ Object (readonly)
Returns the value of attribute next_link.
7 8 9 |
# File 'lib/shopify_api/pagination_link_headers.rb', line 7 def next_link @next_link end |
#previous_link ⇒ Object (readonly)
Returns the value of attribute previous_link.
7 8 9 |
# File 'lib/shopify_api/pagination_link_headers.rb', line 7 def previous_link @previous_link end |