Class: Evilution::Mutator::Operator::SplatOperator

Inherits:
Base
  • Object
show all
Defined in:
lib/evilution/mutator/operator/splat_operator.rb

Instance Attribute Summary

Attributes inherited from Base

#mutations

Instance Method Summary collapse

Methods inherited from Base

#call, clear_parse_cache!, #initialize, operator_name, parsed_tree_for

Constructor Details

This class inherits a constructor from Evilution::Mutator::Base

Instance Method Details

#visit_assoc_splat_node(node) ⇒ Object



17
18
19
20
21
# File 'lib/evilution/mutator/operator/splat_operator.rb', line 17

def visit_assoc_splat_node(node)
  mutate_remove_double_splat(node) if node.value && !hash_elements.include?(node)

  super
end

#visit_hash_node(node) ⇒ Object



12
13
14
15
# File 'lib/evilution/mutator/operator/splat_operator.rb', line 12

def visit_hash_node(node)
  node.elements.each { |el| hash_elements.add(el) }
  super
end

#visit_splat_node(node) ⇒ Object



6
7
8
9
10
# File 'lib/evilution/mutator/operator/splat_operator.rb', line 6

def visit_splat_node(node)
  mutate_remove_splat(node) if node.expression

  super
end