Exception: Pagy::VariableError

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

Direct Known Subclasses

OverflowError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pagy) ⇒ VariableError

Returns a new instance of VariableError.



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

def initialize(pagy)
  @pagy = pagy
end

Instance Attribute Details

#pagyObject (readonly)

Returns the value of attribute pagy.



4
5
6
# File 'lib/pagy/exceptions.rb', line 4

def pagy
  @pagy
end

Instance Method Details

#valueObject



15
16
17
# File 'lib/pagy/exceptions.rb', line 15

def value
  pagy.vars[variable]
end

#variableObject



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

def variable
  message =~ /expected :([\w]+)/
  $1.to_sym if $1
end