Class: Dry::Monads::SuperDiff::ITBuilders::DictConstructor Private

Inherits:
RegularConstructor
  • 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.

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)


304
# File 'lib/dry/monads/extensions/super_diff.rb', line 304

def self.applies_to?(object) = super && IS_HASH.call(object)

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.



306
307
308
309
310
311
312
313
314
315
316
317
318
# File 'lib/dry/monads/extensions/super_diff.rb', line 306

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

    t2.nested do |t3|
      t3.add_inspection_of ::Dry::Monads::SuperDiff::Dict.new(
        EXTRACT_VALUE.(object)
      )
    end

    t2.add_text(")")
  end
end