class RuboCop::AST::EnsureNode
to all ‘ensure` nodes within RuboCop.
node when the builder constructs the AST, making its methods available
A node extension for `ensure` nodes. This will be used in place of a plain
def body
- Use `EnsureNode#branch`
Returns:
-
(Node, nil)
- The body of the `ensure`.
def body branch end
def branch
-
(Node, nil)
- the body of the ensure branch.
def branch node_parts[1] end
def rescue_node
-
(Node, nil)
- The `rescue` node.
def rescue_node node_parts[0] if node_parts[0].rescue_type? end
def void_context?
-
(true)
- whether the `ensure` node body is a void context
def void_context? true end