Class: SuperDiff::Core::InspectionTreeNodes::AsPrefixWhenRenderingToLines

Inherits:
Base
  • Object
show all
Defined in:
lib/super_diff/core/inspection_tree_nodes/as_prefix_when_rendering_to_lines.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#clone_with, #initialize, node_name, #pretty_print, #render

Constructor Details

This class inherits a constructor from SuperDiff::Core::InspectionTreeNodes::Base

Class Method Details

.method_nameObject



11
12
13
# File 'lib/super_diff/core/inspection_tree_nodes/as_prefix_when_rendering_to_lines.rb', line 11

def self.method_name
  :as_prefix_when_rendering_to_lines
end

.nameObject



7
8
9
# File 'lib/super_diff/core/inspection_tree_nodes/as_prefix_when_rendering_to_lines.rb', line 7

def self.name
  :as_prefix_when_rendering_to_lines
end

Instance Method Details

#render_to_lines(object) ⇒ Object



19
20
21
# File 'lib/super_diff/core/inspection_tree_nodes/as_prefix_when_rendering_to_lines.rb', line 19

def render_to_lines(object, **)
  PrefixForNextInspectionTreeNode.new(render_to_string(object))
end

#render_to_string(object) ⇒ Object



15
16
17
# File 'lib/super_diff/core/inspection_tree_nodes/as_prefix_when_rendering_to_lines.rb', line 15

def render_to_string(object)
  block ? render_to_string_in_subtree(object) : immediate_value.to_s
end