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

Deprecated:
  • Use `EnsureNode#branch`

Returns:
  • (Node, nil) - The body of the `ensure`.
def body
  branch
end

def branch

Returns:
  • (Node, nil) - the body of the ensure branch.
def branch
  node_parts[1]
end

def rescue_node

Returns:
  • (Node, nil) - The `rescue` node.
def rescue_node
  node_parts[0] if node_parts[0].rescue_type?
end

def void_context?

Returns:
  • (true) - whether the `ensure` node body is a void context
def void_context?
  true
end