class RuboCop::AST::OpAsgnNode
A node extension for `op_asgn` nodes. This will be used in place of a plain node when the builder constructs the AST
, making its methods available to all assignment nodes within RuboCop
.
Public Instance Methods
assignment_node()
click to toggle source
@return [AsgnNode] the assignment node
# File lib/rubocop/ast/node/op_asgn_node.rb, line 10 def assignment_node node_parts[0] end
expression()
click to toggle source
The expression being assigned to the variable.
@return [Node] the expression being assigned.
# File lib/rubocop/ast/node/op_asgn_node.rb, line 31 def expression node_parts.last end
name()
click to toggle source
The name of the variable being assigned as a symbol.
@return [Symbol] the name of the variable being assigned
# File lib/rubocop/ast/node/op_asgn_node.rb, line 17 def name assignment_node.name end
operator()
click to toggle source
The operator being used for assignment as a symbol.
@return [Symbol] the assignment operator
# File lib/rubocop/ast/node/op_asgn_node.rb, line 24 def operator node_parts[1] end