Class: Locomotive::Coal::PaginatedResources
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Locomotive::Coal::PaginatedResources
- Defined in:
- lib/locomotive/coal/paginated_resources.rb
Instance Attribute Summary collapse
-
#_page ⇒ Object
Returns the value of attribute _page.
-
#_total_entries ⇒ Object
Returns the value of attribute _total_entries.
-
#_total_pages ⇒ Object
Returns the value of attribute _total_pages.
Instance Method Summary collapse
- #_next_page ⇒ Object
-
#initialize(list, page, total_pages, total_entries) ⇒ PaginatedResources
constructor
A new instance of PaginatedResources.
Constructor Details
#initialize(list, page, total_pages, total_entries) ⇒ PaginatedResources
Returns a new instance of PaginatedResources.
7 8 9 10 |
# File 'lib/locomotive/coal/paginated_resources.rb', line 7 def initialize(list, page, total_pages, total_entries) @_page, @_total_pages, @_total_entries = page, total_pages, total_entries super(list) end |
Instance Attribute Details
#_page ⇒ Object
Returns the value of attribute _page.
5 6 7 |
# File 'lib/locomotive/coal/paginated_resources.rb', line 5 def _page @_page end |
#_total_entries ⇒ Object
Returns the value of attribute _total_entries.
5 6 7 |
# File 'lib/locomotive/coal/paginated_resources.rb', line 5 def _total_entries @_total_entries end |
#_total_pages ⇒ Object
Returns the value of attribute _total_pages.
5 6 7 |
# File 'lib/locomotive/coal/paginated_resources.rb', line 5 def _total_pages @_total_pages end |
Instance Method Details
#_next_page ⇒ Object
12 13 14 15 16 |
# File 'lib/locomotive/coal/paginated_resources.rb', line 12 def _next_page if @_page < @_total_pages @_page + 1 end end |