Class: Mutiny::Mutants::Mutation::Method::Helpers::OperatorReplacement::InfixOperator
- Inherits:
-
Object
- Object
- Mutiny::Mutants::Mutation::Method::Helpers::OperatorReplacement::InfixOperator
- Defined in:
- lib/mutiny/mutants/mutation/method/helpers/operator_replacement.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #build_literal(builder, left, right) ⇒ Object
- #build_pattern(builder) ⇒ Object
-
#initialize(name, root = :send) ⇒ InfixOperator
constructor
A new instance of InfixOperator.
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
#name ⇒ Object (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 |
#root ⇒ Object (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 |