Class: SuperDiff::OperationTrees::Base

Inherits:
SimpleDelegator
  • Object
show all
Extended by:
ImplementationChecks
Defined in:
lib/super_diff/operation_trees/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.applies_to?(_value) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/super_diff/operation_trees/base.rb', line 6

def self.applies_to?(_value)
  unimplemented_class_method!
end

Instance Method Details

#pretty_print(pp) ⇒ Object

rubocop:enable Lint/UnusedMethodArgument



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/super_diff/operation_trees/base.rb', line 18

def pretty_print(pp)
  pp.text "#{self.class.name}.new(["
  pp.group_sub do
    pp.nest(2) do
      pp.breakable
      pp.seplist(self) do |value|
        pp.pp value
      end
    end
  end
  pp.breakable
  pp.text("])")
end

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

rubocop:disable Lint/UnusedMethodArgument

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/super_diff/operation_trees/base.rb', line 13

def to_diff(indent_level:, add_comma: false, collection_prefix: nil)
  raise NotImplementedError
end