Class: LibRubyParser::Nodes::Ensure
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::Ensure
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents a block of code with ensure (i.e. ‘begin; ensure; end`)
Instance Attribute Summary collapse
-
#body ⇒ Node?
readonly
Block of code that is wrapped into
ensureNote: that’s the body of theensureblock. -
#ensure ⇒ Node?
readonly
Body of the
ensureblock. -
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#keyword_l ⇒ Loc
readonly
Location of the
ensurekeyword.
Instance Attribute Details
#body ⇒ Node? (readonly)
Block of code that is wrapped into ensure Note: that’s the body of the ensure block
‘Int(“1”)` for `begin; 1; ensure; 2; end`
1355 1356 1357 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1355 def body @body end |
#ensure ⇒ Node? (readonly)
Body of the ensure block
‘Int(“2”)` for `begin; 1; ensure; 2; end`
1361 1362 1363 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1361 def ensure @ensure end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
“‘text begin; 1; rescue; 2; else; 3; ensure; 4; end
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
“‘
Note: begin/end belong to KwBegin node.
1381 1382 1383 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1381 def expression_l @expression_l end |
#keyword_l ⇒ Loc (readonly)
Location of the ensure keyword
“‘text begin; ensure; end
~~~~~~
“‘
1370 1371 1372 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1370 def keyword_l @keyword_l end |