Class: SuperDiff::Operations::BinaryOperation
- Inherits:
-
Object
- Object
- SuperDiff::Operations::BinaryOperation
- Defined in:
- lib/super_diff/operations/binary_operation.rb
Instance Attribute Summary collapse
-
#left_collection ⇒ Object
readonly
Returns the value of attribute left_collection.
-
#left_index ⇒ Object
readonly
Returns the value of attribute left_index.
-
#left_key ⇒ Object
readonly
Returns the value of attribute left_key.
-
#left_value ⇒ Object
readonly
Returns the value of attribute left_value.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#right_collection ⇒ Object
readonly
Returns the value of attribute right_collection.
-
#right_index ⇒ Object
readonly
Returns the value of attribute right_index.
-
#right_key ⇒ Object
readonly
Returns the value of attribute right_key.
-
#right_value ⇒ Object
readonly
Returns the value of attribute right_value.
Instance Method Summary collapse
-
#initialize(name:, left_collection:, right_collection:, left_index:, right_index:, left_key:, right_key:, left_value:, right_value:, child_operations: []) ⇒ BinaryOperation
constructor
A new instance of BinaryOperation.
- #should_add_comma_after_displaying? ⇒ Boolean
Constructor Details
#initialize(name:, left_collection:, right_collection:, left_index:, right_index:, left_key:, right_key:, left_value:, right_value:, child_operations: []) ⇒ BinaryOperation
Returns a new instance of BinaryOperation.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/super_diff/operations/binary_operation.rb', line 17 def initialize( name:, left_collection:, right_collection:, left_index:, right_index:, left_key:, right_key:, left_value:, right_value:, child_operations: [] ) @name = name @left_collection = left_collection @right_collection = right_collection @left_index = left_index @right_index = right_index @left_key = left_key @right_key = right_key @left_value = left_value @right_value = right_value @child_operations = child_operations end |
Instance Attribute Details
#left_collection ⇒ Object (readonly)
Returns the value of attribute left_collection.
4 5 6 |
# File 'lib/super_diff/operations/binary_operation.rb', line 4 def left_collection @left_collection end |
#left_index ⇒ Object (readonly)
Returns the value of attribute left_index.
4 5 6 |
# File 'lib/super_diff/operations/binary_operation.rb', line 4 def left_index @left_index end |
#left_key ⇒ Object (readonly)
Returns the value of attribute left_key.
4 5 6 |
# File 'lib/super_diff/operations/binary_operation.rb', line 4 def left_key @left_key end |
#left_value ⇒ Object (readonly)
Returns the value of attribute left_value.
4 5 6 |
# File 'lib/super_diff/operations/binary_operation.rb', line 4 def left_value @left_value end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/super_diff/operations/binary_operation.rb', line 4 def name @name end |
#right_collection ⇒ Object (readonly)
Returns the value of attribute right_collection.
4 5 6 |
# File 'lib/super_diff/operations/binary_operation.rb', line 4 def right_collection @right_collection end |
#right_index ⇒ Object (readonly)
Returns the value of attribute right_index.
4 5 6 |
# File 'lib/super_diff/operations/binary_operation.rb', line 4 def right_index @right_index end |
#right_key ⇒ Object (readonly)
Returns the value of attribute right_key.
4 5 6 |
# File 'lib/super_diff/operations/binary_operation.rb', line 4 def right_key @right_key end |
#right_value ⇒ Object (readonly)
Returns the value of attribute right_value.
4 5 6 |
# File 'lib/super_diff/operations/binary_operation.rb', line 4 def right_value @right_value end |
Instance Method Details
#should_add_comma_after_displaying? ⇒ Boolean
41 42 43 44 |
# File 'lib/super_diff/operations/binary_operation.rb', line 41 def left_index < left_collection.size - 1 || right_index < right_collection.size - 1 end |