Class: Exceptions::NameError::Handler
- Inherits:
-
ExceptionsBase
- Object
- Base
- ExceptionsBase
- Exceptions::NameError::Handler
- Defined in:
- lib/pry-byetypo/exceptions/name_error/handler.rb
Constant Summary
Constants included from Setup::Store
Setup::Store::DEFAULT_STORE_PATH, Setup::Store::SEVEN_DAYS
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#pry ⇒ Object
readonly
Returns the value of attribute pry.
Instance Method Summary collapse
-
#call ⇒ Object
FIXME: github.com/rubocop/rubocop-performance/issues/438 rubocop:disable Performance/ConstantRegexp.
-
#initialize(output, exception, pry) ⇒ Handler
constructor
A new instance of Handler.
Methods included from Setup::Store
#staled_store?, #store, #store_path
Methods inherited from Base
Constructor Details
#initialize(output, exception, pry) ⇒ Handler
Returns a new instance of Handler.
13 14 15 16 17 |
# File 'lib/pry-byetypo/exceptions/name_error/handler.rb', line 13 def initialize(output, exception, pry) @output = output @exception = exception @pry = pry end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
11 12 13 |
# File 'lib/pry-byetypo/exceptions/name_error/handler.rb', line 11 def exception @exception end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
11 12 13 |
# File 'lib/pry-byetypo/exceptions/name_error/handler.rb', line 11 def output @output end |
#pry ⇒ Object (readonly)
Returns the value of attribute pry.
11 12 13 |
# File 'lib/pry-byetypo/exceptions/name_error/handler.rb', line 11 def pry @pry end |
Instance Method Details
#call ⇒ Object
FIXME: github.com/rubocop/rubocop-performance/issues/438 rubocop:disable Performance/ConstantRegexp
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/pry-byetypo/exceptions/name_error/handler.rb', line 21 def call case exception. in /#{Constants::Errors::UNINITIALIZED_CONSTANT}/ ActiveRecord::UninitializedConstant.call(output, exception, pry) in /#{Constants::Errors::UNDEFINED_VARIABLE}/ UndefinedVariable.call(output, exception, pry) else Pry::ExceptionHandler.handle_exception(output, exception, pry) end end |