Exception: Pagy::VariableError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/pagy/exceptions.rb

Overview

Generic variable error

Direct Known Subclasses

OverflowError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pagy, variable, description, value) ⇒ VariableError

Set the variables and prepare the message



9
10
11
12
13
14
# File 'lib/pagy/exceptions.rb', line 9

def initialize(pagy, variable, description, value)
  @pagy     = pagy
  @variable = variable
  @value    = value
  super "expected :#{@variable} #{description}; got #{@value.inspect}"
end

Instance Attribute Details

#pagyObject (readonly)

Returns the value of attribute pagy.



6
7
8
# File 'lib/pagy/exceptions.rb', line 6

def pagy
  @pagy
end

#valueObject (readonly)

Returns the value of attribute value.



6
7
8
# File 'lib/pagy/exceptions.rb', line 6

def value
  @value
end

#variableObject (readonly)

Returns the value of attribute variable.



6
7
8
# File 'lib/pagy/exceptions.rb', line 6

def variable
  @variable
end