Class: Uchi::Pagy::Console::Collection
- Inherits:
-
Array
- Object
- Array
- Uchi::Pagy::Console::Collection
- Defined in:
- lib/uchi/pagy/modules/console.rb
Instance Method Summary collapse
- #count ⇒ Object
-
#initialize(arr = Array(1..1000)) ⇒ Collection
constructor
A new instance of Collection.
- #limit(value) ⇒ Object
- #offset(value) ⇒ Object
Constructor Details
#initialize(arr = Array(1..1000)) ⇒ Collection
Returns a new instance of Collection.
22 23 24 25 |
# File 'lib/uchi/pagy/modules/console.rb', line 22 def initialize(arr = Array(1..1000)) super @collection = clone end |
Instance Method Details
#count ⇒ Object
29 |
# File 'lib/uchi/pagy/modules/console.rb', line 29 def count(*) = size |
#limit(value) ⇒ Object
28 |
# File 'lib/uchi/pagy/modules/console.rb', line 28 def limit(value) = @collection[0, value] |
#offset(value) ⇒ Object
27 |
# File 'lib/uchi/pagy/modules/console.rb', line 27 def offset(value) = tap { @collection = self[value..] } |