Class: LHS::Pagination::Link

Inherits:
Base
  • Object
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

Constructor Details

This class inherits a constructor from LHS::Pagination::Base

Instance Method Details

#pages_leftObject


10
11
12
# File 'lib/lhs/pagination/link.rb', line 10

def pages_left
  pages_left? ? 1 : 0
end

#pages_left?Boolean

Returns:

  • (Boolean)

14
15
16
# File 'lib/lhs/pagination/link.rb', line 14

def pages_left?
  data._raw[:next].present?
end

#parallel?Boolean

Returns:

  • (Boolean)

18
19
20
# File 'lib/lhs/pagination/link.rb', line 18

def parallel?
  false
end

#totalObject 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