lib/pagy.rb in pagy-0.8.2 vs lib/pagy.rb in pagy-0.8.3
- old
+ new
@@ -1,20 +1,17 @@
# See Pagy API documentation: https://ddnexus.github.io/pagy/api/pagy
require 'pathname'
-class Pagy ; VERSION = '0.8.2'
+class Pagy ; VERSION = '0.8.3'
class OutOfRangeError < StandardError; end
# root pathname to get the path of pagy files like templates or dictionaries
def self.root; Pathname.new(__FILE__).dirname end
# default core vars
VARS = { page:1, items:20, outset:0, size:[1,4,4,1], page_param: :page, params: {} }
-
- # default I18n vars
- zero_one = [:zero, :one] ; I18N = { file: Pagy.root.join('locales', 'pagy.yml').to_s, plurals: -> (c) {(zero_one[c] || :other).to_s.freeze} }
attr_reader :count, :page, :items, :vars, :pages, :last, :offset, :from, :to, :prev, :next
# merge and validate the options, do some simple aritmetic and set the instance variables
def initialize(vars)