Module: SuperDiff::OperationTreeFlatteners

Defined in:
lib/super_diff/operation_tree_flatteners.rb

Class Method Summary collapse

Class Method Details

.const_missing(missing_const_name) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/super_diff/operation_tree_flatteners.rb', line 5

def self.const_missing(missing_const_name)
  if missing_const_name == :Base
    warn <<~WARNING
      WARNING: SuperDiff::OperationTreeFlatteners::#{missing_const_name} is deprecated and will be removed in the next major release.
      Please use SuperDiff::Core::AbstractOperationTreeFlattener instead.
      #{caller_locations.join("\n")}
    WARNING
    Core::AbstractOperationTreeFlattener
  elsif Basic::OperationTreeFlatteners.const_defined?(missing_const_name)
    warn <<~WARNING
      WARNING: SuperDiff::OperationTreeFlatteners::#{missing_const_name} is deprecated and will be removed in the next major release.
      Please use SuperDiff::Basic::OperationTreeFlatteners::#{missing_const_name} instead.
      #{caller_locations.join("\n")}
    WARNING
    Basic::OperationTreeFlatteners.const_get(missing_const_name)
  else
    super
  end
end