Class: SuperDiff::Operations::UnaryOperation
- Inherits:
-
Object
- Object
- SuperDiff::Operations::UnaryOperation
- Defined in:
- lib/super_diff/operations/unary_operation.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name:, collection:, key:, value:, index:) ⇒ UnaryOperation
constructor
A new instance of UnaryOperation.
- #should_add_comma_after_displaying? ⇒ Boolean
Constructor Details
#initialize(name:, collection:, key:, value:, index:) ⇒ UnaryOperation
Returns a new instance of UnaryOperation.
12 13 14 15 16 17 18 |
# File 'lib/super_diff/operations/unary_operation.rb', line 12 def initialize(name:, collection:, key:, value:, index:) @name = name @collection = collection @key = key @value = value @index = index end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
4 5 6 |
# File 'lib/super_diff/operations/unary_operation.rb', line 4 def collection @collection end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
4 5 6 |
# File 'lib/super_diff/operations/unary_operation.rb', line 4 def key @key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/super_diff/operations/unary_operation.rb', line 4 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/super_diff/operations/unary_operation.rb', line 4 def value @value end |
Instance Method Details
#should_add_comma_after_displaying? ⇒ Boolean
20 21 22 |
# File 'lib/super_diff/operations/unary_operation.rb', line 20 def index < collection.size - 1 end |