class RuboCop::AST::EnsureNode

def body

Deprecated:
  • Use `EnsureNode#branch`

Returns:
  • (Node, nil) - The body of the `ensure`.
def body
  first_caller = caller(1..1).first
  unless DEPRECATION_WARNING_LOCATION_CACHE.include?(first_caller)
    warn '`EnsureNode#body` is deprecated and will be changed in the next major version of ' \
         'rubocop-ast. Use `EnsureNode#branch` instead to get the body of the `ensure` branch.'
    warn "Called from:\n#{caller.join("\n")}\n\n"
    DEPRECATION_WARNING_LOCATION_CACHE << first_caller
  end
  branch
end