Sha256: 3ea66a6d39f0aa6a7f3e87c366dd7bcb56adb1953bebc88d2dcf36b98c92eb7e
Contents?: true
Size: 974 Bytes
Versions: 64
Compression:
Stored size: 974 Bytes
Contents
require 'active_support' class LHS::Record # Allows configuring endpoints # like which keys are used for the items, offset, total etc. module Configuration extend ActiveSupport::Concern mattr_accessor :configuration module ClassMethods def configuration(args) @configuration = args.freeze || {} end def items_key (@configuration.try(:[], :items_key) || :items).to_sym end def limit_key (@configuration.try(:[], :limit_key) || :limit).to_sym end def total_key (@configuration.try(:[], :total_key) || :total).to_sym end # Key used for determine current page def pagination_key (@configuration.try(:[], :pagination_key) || :offset).to_sym end # Strategy used for calculationg next pages and navigate pages def pagination_strategy (@configuration.try(:[], :pagination_strategy) || :offset).to_sym end end end end
Version data entries
64 entries across 64 versions & 1 rubygems