Class: LibRubyParser::Nodes::RescueBody
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::RescueBody
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents a single rescue handler (i.e. ‘rescue E => e …`)
Instance Attribute Summary collapse
-
#assoc_l ⇒ Loc?
readonly
Location of the ‘=>` operator.
-
#begin_l ⇒ Loc?
readonly
Location of the
thenkeyword. -
#body ⇒ Node?
readonly
Body of the handler.
-
#exc_list ⇒ Node?
readonly
A list of exception classes.
-
#exc_var ⇒ Node?
readonly
Variable that captures exception.
-
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#keyword_l ⇒ Loc
readonly
Location of the
rescuekeyword.
Instance Attribute Details
#assoc_l ⇒ Loc? (readonly)
Location of the ‘=>` operator
“‘text begin; 1; rescue E => e; 2; end
~~
“‘
None if exception is not captured.
3567 3568 3569 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3567 def assoc_l @assoc_l end |
#begin_l ⇒ Loc? (readonly)
Location of the then keyword
“‘text begin; 1; rescue E => e then; 2; end
~~~~
“‘
then is optional, so begin_l can be None
3578 3579 3580 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3578 def begin_l @begin_l end |
#body ⇒ Node? (readonly)
Body of the handler
3547 3548 3549 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3547 def body @body end |
#exc_list ⇒ Node? (readonly)
A list of exception classes
None if no classes specified (i.e. ‘rescue => e; …` or just `rescue; …`)
3537 3538 3539 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3537 def exc_list @exc_list end |
#exc_var ⇒ Node? (readonly)
Variable that captures exception
None if no variable specified (i.e. ‘rescue E; …` or just `rescue; … `)
3543 3544 3545 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3543 def exc_var @exc_var end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
“‘text begin; 1; rescue E => e then; 2; end
~~~~~~~~~~~~~~~~~~~~~
“‘
3587 3588 3589 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3587 def expression_l @expression_l end |
#keyword_l ⇒ Loc (readonly)
Location of the rescue keyword
“‘text begin; 1; rescue E => e; 2; end
~~~~~~
“‘
3556 3557 3558 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3556 def keyword_l @keyword_l end |