Class: EPlat::Paginated::LinkHeaders
- Inherits:
-
Object
- Object
- EPlat::Paginated::LinkHeaders
- Defined in:
- lib/e_plat/resource/paginated/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) ⇒ LinkHeaders
constructor
A new instance of LinkHeaders.
Constructor Details
#initialize(link_header) ⇒ LinkHeaders
Returns a new instance of LinkHeaders.
11 12 13 14 15 16 |
# File 'lib/e_plat/resource/paginated/link_headers.rb', line 11 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.
9 10 11 |
# File 'lib/e_plat/resource/paginated/link_headers.rb', line 9 def next_link @next_link end |
#previous_link ⇒ Object (readonly)
Returns the value of attribute previous_link.
9 10 11 |
# File 'lib/e_plat/resource/paginated/link_headers.rb', line 9 def previous_link @previous_link end |