Class: LHS::Pagination::Link
- Inherits:
-
Base
- Object
- Base
- LHS::Pagination::Link
show all
- Defined in:
- lib/lhs/pagination/link.rb
Constant Summary
Constants inherited
from Base
Base::DEFAULT_LIMIT
Instance Attribute Summary
Attributes inherited from Base
#data
Instance Method Summary
collapse
Methods inherited from Base
#current_page, #first_page, #initialize, #last_page, #limit, #limit_value, #next?, #next_offset, #next_page, #offset, page_to_offset, #prev_page, #previous?, #total_pages
Instance Method Details
#pages_left ⇒ Object
10
11
12
|
# File 'lib/lhs/pagination/link.rb', line 10
def pages_left
pages_left? ? 1 : 0
end
|
#pages_left? ⇒ Boolean
14
15
16
|
# File 'lib/lhs/pagination/link.rb', line 14
def pages_left?
data._raw[:next].present?
end
|
#parallel? ⇒ Boolean
18
19
20
|
# File 'lib/lhs/pagination/link.rb', line 18
def parallel?
false
end
|
#total ⇒ Object
Also known as:
count
4
5
6
|
# File 'lib/lhs/pagination/link.rb', line 4
def total
data._raw.dig(*_record.items_key).count || 0
end
|