Class: Folio::Ordinal::Page::DecoratedArray
- Inherits:
-
Decorator
- Object
- SimpleDelegator
- Page::Decorator
- Decorator
- Folio::Ordinal::Page::DecoratedArray
- Defined in:
- lib/folio/ordinal/page.rb
Instance Attribute Summary
Attributes included from Page
#current_page, #first_page, #next_page, #ordinal_pages, #previous_page, #total_entries
Instance Method Summary collapse
-
#initialize ⇒ DecoratedArray
constructor
A new instance of DecoratedArray.
- #replace(array) ⇒ Object
Methods included from Folio::Ordinal::Page
create, #current_page=, decorate, #first_page, #last_page, #next_page, #next_page=, #offset, #ordinal_pages, #out_of_bounds?, #previous_page
Methods included from Page
create, decorate, #last_page, #last_page=, #total_pages
Methods included from PerPage
Constructor Details
#initialize ⇒ DecoratedArray
Returns a new instance of DecoratedArray.
84 85 86 |
# File 'lib/folio/ordinal/page.rb', line 84 def initialize super [] end |
Instance Method Details
#replace(array) ⇒ Object
88 89 90 91 92 93 94 |
# File 'lib/folio/ordinal/page.rb', line 88 def replace(array) result = super if total_entries.nil? and length < per_page and (current_page == 1 or length > 0) self.total_entries = offset + length end result end |