Class: NextPageable::Page
- Inherits:
-
Object
- Object
- NextPageable::Page
- Includes:
- Enumerable
- Defined in:
- lib/next-pageable/page.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#next_page_index ⇒ Object
readonly
Returns the value of attribute next_page_index.
Instance Method Summary collapse
-
#initialize(collection:, next_page_index:) ⇒ Page
constructor
A new instance of Page.
- #next_page? ⇒ Boolean
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
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
7 8 9 |
# File 'lib/next-pageable/page.rb', line 7 def collection @collection end |
#next_page_index ⇒ Object (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
21 22 23 |
# File 'lib/next-pageable/page.rb', line 21 def next_page? next_page_index.present? end |