Class: SuperDiff::DiffFormatters::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/super_diff/diff_formatters/base.rb

Direct Known Subclasses

Array, Hash, MultiLineString, Object

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operations, indent_level:, collection_prefix: "", add_comma: false) ⇒ Base

Returns a new instance of Base.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/super_diff/diff_formatters/base.rb', line 12

def initialize(
  operations,
  indent_level:,
  collection_prefix: "",
  add_comma: false
)
  @operations = operations
  @indent_level = indent_level
  @collection_prefix = collection_prefix
  @add_comma = add_comma
end

Class Method Details

.applies_to?(_operations) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


4
5
6
# File 'lib/super_diff/diff_formatters/base.rb', line 4

def self.applies_to?(_operations)
  raise NotImplementedError
end

.call(*args) ⇒ Object



8
9
10
# File 'lib/super_diff/diff_formatters/base.rb', line 8

def self.call(*args)
  new(*args).call
end

Instance Method Details

#callObject

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/super_diff/diff_formatters/base.rb', line 24

def call
  raise NotImplementedError
end