class Pagy

def initialize(**vars)

Merge and validate the options, do some simple arithmetic and set the instance variables
def initialize(**vars)
  assign_vars(DEFAULT, vars)
  assign_and_check(count: 0, page: 1, outset: 0)
  assign_limit
  assign_offset
  assign_last
  check_overflow
  @from = [@offset - @outset + 1, @count].min
  @to   = [@offset - @outset + @limit, @count].min
  @in   = [@to - @from + 1, @count].min
  assign_prev_and_next
end