Class: Hexabat::PageRange::LinkHeader
- Inherits:
-
Object
- Object
- Hexabat::PageRange::LinkHeader
- Defined in:
- lib/hexabat/page_range.rb
Constant Summary collapse
- PREV =
/<https:\/\/\S+\?page=(?'prev_page'\d+)[\S]+>; rel="prev"/
- LAST =
/<https:\/\/\S+\?page=(?'last_page'\d+)[\S]+>; rel="last"/
Instance Method Summary collapse
-
#initialize(header) ⇒ LinkHeader
constructor
A new instance of LinkHeader.
- #last ⇒ Object
- #prev ⇒ Object
Constructor Details
#initialize(header) ⇒ LinkHeader
Returns a new instance of LinkHeader.
14 15 16 |
# File 'lib/hexabat/page_range.rb', line 14 def initialize(header) @header = header end |
Instance Method Details
#last ⇒ Object
18 19 20 21 |
# File 'lib/hexabat/page_range.rb', line 18 def last return prev.succ if last_missing? or last_incorrect? return header_last end |
#prev ⇒ Object
23 24 25 |
# File 'lib/hexabat/page_range.rb', line 23 def prev @prev ||= extract(PREV) end |