Class: Mutiny::Mutants::Mutation::Method::Helpers::OperatorReplacement::InfixOperator

Inherits:
Object
  • Object
show all
Defined in:
lib/mutiny/mutants/mutation/method/helpers/operator_replacement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, root = :send) ⇒ InfixOperator

Returns a new instance of InfixOperator.



63
64
65
66
# File 'lib/mutiny/mutants/mutation/method/helpers/operator_replacement.rb', line 63

def initialize(name, root = :send)
  @name = name
  @root = root
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



61
62
63
# File 'lib/mutiny/mutants/mutation/method/helpers/operator_replacement.rb', line 61

def name
  @name
end

#rootObject (readonly)

Returns the value of attribute root.



61
62
63
# File 'lib/mutiny/mutants/mutation/method/helpers/operator_replacement.rb', line 61

def root
  @root
end

Instance Method Details

#build_literal(builder, left, right) ⇒ Object



72
73
74
# File 'lib/mutiny/mutants/mutation/method/helpers/operator_replacement.rb', line 72

def build_literal(builder, left, right)
  builder.literal!(root, left, builder.literal!(name), right)
end

#build_pattern(builder) ⇒ Object



68
69
70
# File 'lib/mutiny/mutants/mutation/method/helpers/operator_replacement.rb', line 68

def build_pattern(builder)
  builder.literal!(root, builder.LEFT, name, builder.RIGHT)
end