class Dry::Monads::SuperDiff::Tuple::Dict::OTFlatteners::MonasAsCollectionConstructor::RegularConstructor::TupleConstructor::OT::RegularConstructor::TupleConstructor::Tuple::Dict::OTBuilders::CompareDefault
Public Class Methods
Source
# File lib/dry/monads/extensions/super_diff.rb, line 141 def self.applies_to?(expected, actual) VALUES.include?(expected.class) && actual.instance_of?(expected.class) end
Protected Instance Methods
Source
# File lib/dry/monads/extensions/super_diff.rb, line 152 def attribute_names = [:value] private def establish_expected_and_actual_attributes @expected_attributes = get_value(expected) @actual_attributes = get_value(actual) end def get_value(object) v = EXTRACT_VALUE.(object) if Unit.equal?(v) EMPTY_HASH else {value: v} end end end
Source
# File lib/dry/monads/extensions/super_diff.rb, line 148 def build_operation_tree OT::RegularConstructor.new([], underlying_object: actual) end
Source
# File lib/dry/monads/extensions/super_diff.rb, line 156 def establish_expected_and_actual_attributes @expected_attributes = get_value(expected) @actual_attributes = get_value(actual) end
Source
# File lib/dry/monads/extensions/super_diff.rb, line 161 def get_value(object) v = EXTRACT_VALUE.(object) if Unit.equal?(v) EMPTY_HASH else {value: v} end end