Class: Rubyzen::Declarations::RescueDeclaration
- Inherits:
-
Object
- Object
- Rubyzen::Declarations::RescueDeclaration
- Defined in:
- lib/rubyzen/declarations/rescue_declaration.rb
Overview
Represents a rescue clause within a method or block.
Instance Attribute Summary collapse
- #node ⇒ RuboCop::AST::Node readonly
- #parent ⇒ MethodDeclaration, BlockDeclaration readonly
Instance Method Summary collapse
-
#exception_types ⇒ Array<String>
Returns the rescued exception class names.
-
#initialize(node, parent) ⇒ RescueDeclaration
constructor
A new instance of RescueDeclaration.
Methods included from Providers::ClassNameProvider
Methods included from Providers::LineNumberProvider
Methods included from Providers::FilePathProvider
Constructor Details
#initialize(node, parent) ⇒ RescueDeclaration
Returns a new instance of RescueDeclaration.
22 23 24 25 |
# File 'lib/rubyzen/declarations/rescue_declaration.rb', line 22 def initialize(node, parent) @node = node @parent = parent end |
Instance Attribute Details
#node ⇒ RuboCop::AST::Node (readonly)
15 16 17 |
# File 'lib/rubyzen/declarations/rescue_declaration.rb', line 15 def node @node end |
#parent ⇒ MethodDeclaration, BlockDeclaration (readonly)
18 19 20 |
# File 'lib/rubyzen/declarations/rescue_declaration.rb', line 18 def parent @parent end |
Instance Method Details
#exception_types ⇒ Array<String>
Returns the rescued exception class names. Defaults to [“StandardError”] for bare rescue.
31 32 33 |
# File 'lib/rubyzen/declarations/rescue_declaration.rb', line 31 def exception_types extract_exception_types end |