Class: Dry::Monads::SuperDiff::ITBuilders::RegularConstructor Private

Inherits:
SuperDiff::Basic::InspectionTreeBuilders::CustomObject
  • Object
show all
Defined in:
lib/dry/monads/extensions/super_diff.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Direct Known Subclasses

DictConstructor, TupleConstructor

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.applies_to?(object) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


258
259
260
# File 'lib/dry/monads/extensions/super_diff.rb', line 258

def self.applies_to?(object)
  VALUES.include?(object.class)
end

Instance Method Details

#callObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/dry/monads/extensions/super_diff.rb', line 262

def call
  build_tree do |t2|
    t2.add_text("#{TOKEN_MAP[object.class]}(")

    v = EXTRACT_VALUE.(object)

    unless Unit.equal?(v)
      t2.nested do |t3|
        t3.add_inspection_of v
      end
    end

    t2.add_text(")")
  end
end