Class: NextPageable::Page

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/next-pageable/page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collection:, next_page_index:) ⇒ Page

Returns a new instance of Page.



10
11
12
13
# File 'lib/next-pageable/page.rb', line 10

def initialize(collection:, next_page_index:)
  @collection = collection
  @next_page_index = next_page_index
end

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



7
8
9
# File 'lib/next-pageable/page.rb', line 7

def collection
  @collection
end

#next_page_indexObject (readonly)

Returns the value of attribute next_page_index.



8
9
10
# File 'lib/next-pageable/page.rb', line 8

def next_page_index
  @next_page_index
end

Instance Method Details

#next_page?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/next-pageable/page.rb', line 21

def next_page?
  next_page_index.present?
end