Module: SuperDiff::ObjectInspection

Defined in:
lib/super_diff/object_inspection.rb

Defined Under Namespace

Modules: InspectionTreeBuilders, Nodes

Class Method Summary collapse

Class Method Details

.const_missing(missing_const_name) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/super_diff/object_inspection.rb', line 42

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