Class: SuperDiff::Core::InspectionTreeNodes::Inspection
- Inherits:
-
Base
- Object
- Base
- SuperDiff::Core::InspectionTreeNodes::Inspection
show all
- Defined in:
- lib/super_diff/core/inspection_tree_nodes/inspection.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#clone_with, #initialize, #pretty_print, #render
Class Method Details
.method_name ⇒ Object
11
12
13
|
# File 'lib/super_diff/core/inspection_tree_nodes/inspection.rb', line 11
def self.method_name
:add_inspection_of
end
|
.node_name ⇒ Object
7
8
9
|
# File 'lib/super_diff/core/inspection_tree_nodes/inspection.rb', line 7
def self.node_name
:inspection
end
|
Instance Method Details
#render_to_lines(object, type:, indentation_level:) ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/super_diff/core/inspection_tree_nodes/inspection.rb', line 27
def render_to_lines(object, type:, indentation_level:)
value = (block ? evaluate_block(object) : immediate_value)
RecursionGuard.guarding_recursion_of(value) do |already_seen|
if already_seen
[
SuperDiff::Core::Line.new(
type: type,
indentation_level: indentation_level,
value: RecursionGuard::PLACEHOLDER
)
]
else
SuperDiff.inspect_object(
value,
as_lines: true,
type: type,
indentation_level: indentation_level
)
end
end
end
|
#render_to_string(object) ⇒ Object