Class: SuperDiff::OperationSequences::DefaultObject

Inherits:
Base
  • Object
show all
Defined in:
lib/super_diff/operation_sequences/default_object.rb

Direct Known Subclasses

CustomObject

Instance Method Summary collapse

Methods inherited from Base

#pretty_print

Constructor Details

#initialize(collection, value_class:) ⇒ DefaultObject

Returns a new instance of DefaultObject.



4
5
6
7
8
# File 'lib/super_diff/operation_sequences/default_object.rb', line 4

def initialize(collection, value_class:)
  super(collection)

  @value_class = value_class
end

Instance Method Details

#to_diff(indent_level:, add_comma: false, collection_prefix: nil) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/super_diff/operation_sequences/default_object.rb', line 10

def to_diff(indent_level:, add_comma: false, collection_prefix: nil)
  DiffFormatters::DefaultObject.call(
    self,
    indent_level: indent_level,
    collection_prefix: collection_prefix,
    add_comma: add_comma,
    value_class: value_class,
  )
end