Sha256: 3ed9d9f06b67230da458458785a4e51eb2dd86eea7013dd9e2808615a78fc9e0
Contents?: true
Size: 559 Bytes
Versions: 21
Compression:
Stored size: 559 Bytes
Contents
# frozen_string_literal: true module Drillbit class Parameters class Page PAGING_PARAMETERS = %w{number size limit offset cursor}.freeze DEFAULT_STARTING_PAGE = 1 DEFAULT_PAGE_SIZE = 25 attr_accessor :raw_parameters def initialize(raw_parameters) self.raw_parameters = raw_parameters || {} end def present? (raw_parameters.keys & PAGING_PARAMETERS).any? end def page_number raw_parameters['number'] || DEFAULT_STARTING_PAGE end def per_page raw_parameters['size'] || DEFAULT_PAGE_SIZE end end end end
Version data entries
21 entries across 21 versions & 1 rubygems