class SuperDiff::ObjectInspection::Nodes::WhenEmpty
Public Class Methods
method_name()
click to toggle source
# File lib/super_diff/object_inspection/nodes/when_empty.rb, line 9 def self.method_name :when_empty end
node_name()
click to toggle source
# File lib/super_diff/object_inspection/nodes/when_empty.rb, line 5 def self.node_name :when_empty end
Public Instance Methods
render_to_lines(object, type:, indentation_level:)
click to toggle source
# File lib/super_diff/object_inspection/nodes/when_empty.rb, line 21 def render_to_lines(object, type:, indentation_level:) if empty?(object) render_to_lines_in_subtree( object, type: type, indentation_level: indentation_level, ) else [] end end
render_to_string(object)
click to toggle source
# File lib/super_diff/object_inspection/nodes/when_empty.rb, line 13 def render_to_string(object) if empty?(object) render_to_string_in_subtree(object) else "" end end
Private Instance Methods
empty?(object)
click to toggle source
# File lib/super_diff/object_inspection/nodes/when_empty.rb, line 35 def empty?(object) if object.respond_to?(:empty?) object.empty? else object.instance_variables.empty? end end