Module: SuperDiff::ObjectInspection::Nodes

Defined in:
lib/super_diff/object_inspection/nodes.rb,
lib/super_diff/object_inspection/nodes/base.rb,
lib/super_diff/object_inspection/nodes/text.rb,
lib/super_diff/object_inspection/nodes/break.rb,
lib/super_diff/object_inspection/nodes/nesting.rb,
lib/super_diff/object_inspection/nodes/inspection.rb,
lib/super_diff/object_inspection/nodes/when_empty.rb,
lib/super_diff/object_inspection/nodes/when_multiline.rb,
lib/super_diff/object_inspection/nodes/when_non_empty.rb,
lib/super_diff/object_inspection/nodes/when_singleline.rb

Defined Under Namespace

Classes: Base, Break, Inspection, Nesting, Text, WhenEmpty, WhenMultiline, WhenNonEmpty, WhenSingleline

Class Method Summary collapse

Class Method Details

.fetch(type) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/super_diff/object_inspection/nodes.rb', line 26

def self.fetch(type)
  registry.fetch(type) do
    raise(
      KeyError,
      "#{type.inspect} is not included in ObjectInspection::Nodes.registry!",
    )
  end
end

.registryObject



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/super_diff/object_inspection/nodes.rb', line 35

def self.registry
  @_registry ||= {
    break: Break,
    inspection: Inspection,
    nesting: Nesting,
    text: Text,
    when_empty: WhenEmpty,
    when_multiline: WhenMultiline,
    when_non_empty: WhenNonEmpty,
    when_singleline: WhenSingleline,
  }
end