Add Mutator::Node#parent_node
This commit is contained in:
parent
8b09927a7b
commit
cb2b53933d
1 changed files with 15 additions and 1 deletions
|
@ -211,6 +211,20 @@ module Mutant
|
|||
end
|
||||
end
|
||||
|
||||
# Return parent node
|
||||
#
|
||||
# @return [Parser::AST::Node] node
|
||||
# if parent with node is presnet
|
||||
#
|
||||
# @return [nil]
|
||||
# otherwise
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def parent_node
|
||||
parent && parent.node
|
||||
end
|
||||
|
||||
# Return parent type
|
||||
#
|
||||
# @return [Symbol] type
|
||||
|
@ -222,7 +236,7 @@ module Mutant
|
|||
# @api private
|
||||
#
|
||||
def parent_type
|
||||
parent && parent.node.type
|
||||
parent_node && parent_node.type
|
||||
end
|
||||
|
||||
# Test if the node is the left of an or_asgn or op_asgn
|
||||
|
|
Loading…
Add table
Reference in a new issue