class Firuta::Commands::Paginate

Constants

DEFAULT_PAGE
DEFAULT_PER_PAGE

Public Instance Methods

apply_to(collection) click to toggle source
# File lib/firuta/commands/paginate.rb, line 9
def apply_to(collection)
  collection
    .each_slice(@params.first[:page_size] || DEFAULT_PER_PAGE)
    .to_a[@params.first[:page] || DEFAULT_PAGE]
end