Class: Fastererer::RescueCall
- Inherits:
-
Object
- Object
- Fastererer::RescueCall
- Defined in:
- lib/fastererer/rescue_call.rb
Instance Attribute Summary collapse
-
#element ⇒ Object
readonly
Returns the value of attribute element.
Instance Method Summary collapse
-
#initialize(node) ⇒ RescueCall
constructor
A new instance of RescueCall.
-
#rescue_classes ⇒ Object
Only unqualified constants: a namespaced ‘Foo::NoMethodError` is not the core NoMethodError, so it must not match the rescue_vs_respond_to check.
Constructor Details
#initialize(node) ⇒ RescueCall
Returns a new instance of RescueCall.
9 10 11 |
# File 'lib/fastererer/rescue_call.rb', line 9 def initialize(node) @element = node end |
Instance Attribute Details
#element ⇒ Object (readonly)
Returns the value of attribute element.
7 8 9 |
# File 'lib/fastererer/rescue_call.rb', line 7 def element @element end |
Instance Method Details
#rescue_classes ⇒ Object
Only unqualified constants: a namespaced ‘Foo::NoMethodError` is not the core NoMethodError, so it must not match the rescue_vs_respond_to check.
15 16 17 18 19 |
# File 'lib/fastererer/rescue_call.rb', line 15 def rescue_classes @rescue_classes ||= element.exceptions.filter_map do |exception| exception.name if exception.is_a?(Prism::ConstantReadNode) end end |