class RuboCop::AST::ResbodyNode
available to all ‘resbody` nodes within RuboCop.
plain node when the builder constructs the AST, making its methods
A node extension for `resbody` nodes. This will be used in place of a
def body
-
(Node, nil)
- The body of the `resbody`.
def body node_parts[2] end
def branch_index
-
(Integer)
- the index of the `resbody` branch
def branch_index parent.resbody_branches.index(self) end
def exception_variable
-
(Node, nil)
- The exception variable of the `resbody`.
def exception_variable node_parts[1] end
def exceptions
-
(Array
- an array of exception nodes)
def exceptions exceptions_node = node_parts[0] if exceptions_node.nil? [] elsif exceptions_node.array_type? exceptions_node.values else [exceptions_node] end end