Class: LibRubyParser::Nodes::Rescue
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::Rescue
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents a rescue
block
Instance Attribute Summary collapse
-
#body ⇒ Node?
readonly
Body of the block that is wrapped into
rescue
(i.e. the part that may throw an error). -
#else ⇒ Node?
readonly
Else branch.
-
#else_l ⇒ Loc?
readonly
Location of the
else
keyword. -
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#rescue_bodies ⇒ ::Array<Node>
readonly
A list of
rescue
handlers (seeRescueBody
node).
Instance Attribute Details
#body ⇒ Node? (readonly)
Body of the block that is wrapped into rescue
(i.e. the part that may throw an error)
3495 3496 3497 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3495 def body @body end |
#else ⇒ Node? (readonly)
Else branch.
None
if there's no else
branch
3505 3506 3507 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3505 def else @else end |
#else_l ⇒ Loc? (readonly)
Location of the else
keyword
begin; 1; rescue StandardError => e; 2; else; 3; end
~~~~
None
if there's no else
branch
3516 3517 3518 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3516 def else_l @else_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
begin; 1; rescue StandardError => e; 2; else; 3; end
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note: begin/end
keywords belong to KwBegin
node
3527 3528 3529 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3527 def expression_l @expression_l end |
#rescue_bodies ⇒ ::Array<Node> (readonly)
A list of rescue
handlers (see RescueBody
node)
3499 3500 3501 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3499 def rescue_bodies @rescue_bodies end |