Exception: Pagy::VariableError
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- Pagy::VariableError
- Defined in:
- lib/pagy/exceptions.rb
Overview
Generic variable error
Direct Known Subclasses
Instance Attribute Summary collapse
-
#pagy ⇒ Object
readonly
Returns the value of attribute pagy.
Instance Method Summary collapse
-
#initialize(pagy) ⇒ VariableError
constructor
A new instance of VariableError.
- #value ⇒ Object
- #variable ⇒ Object
Constructor Details
#initialize(pagy) ⇒ VariableError
Returns a new instance of VariableError.
8 9 10 11 |
# File 'lib/pagy/exceptions.rb', line 8 def initialize(pagy) super @pagy = pagy end |
Instance Attribute Details
#pagy ⇒ Object (readonly)
Returns the value of attribute pagy.
6 7 8 |
# File 'lib/pagy/exceptions.rb', line 6 def pagy @pagy end |
Instance Method Details
#value ⇒ Object
18 19 20 |
# File 'lib/pagy/exceptions.rb', line 18 def value pagy.vars[variable] end |
#variable ⇒ Object
13 14 15 16 |
# File 'lib/pagy/exceptions.rb', line 13 def variable =~ /expected :(\w+)/ Regexp.last_match(1)&.to_sym end |