Class: WrAPI::RequestPagination::DefaultPager
- Inherits:
-
Object
- Object
- WrAPI::RequestPagination::DefaultPager
- Defined in:
- lib/wrapi/pagination.rb
Overview
Defaut pages asumes all data retrieved in a single go.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(page_size = nil) ⇒ DefaultPager
constructor
initialize with page size.
-
#more_pages? ⇒ Boolean
assume single page.
-
#next_page!(data = nil) ⇒ Object
go to next page.
- #page_options ⇒ Object
Constructor Details
#initialize(page_size = nil) ⇒ DefaultPager
initialize with page size
13 14 15 |
# File 'lib/wrapi/pagination.rb', line 13 def initialize(page_size=nil) @page = 0 end |
Class Method Details
.data(body) ⇒ Object
33 34 35 |
# File 'lib/wrapi/pagination.rb', line 33 def self.data(body) body end |
Instance Method Details
#more_pages? ⇒ Boolean
assume single page
25 26 27 |
# File 'lib/wrapi/pagination.rb', line 25 def more_pages? @page < 1 end |
#next_page!(data = nil) ⇒ Object
go to next page
19 20 21 22 |
# File 'lib/wrapi/pagination.rb', line 19 def next_page!(data=nil) @page += 1 more_pages? end |
#page_options ⇒ Object
29 30 31 |
# File 'lib/wrapi/pagination.rb', line 29 def {} end |