module AwesomePrint::ContractValueObject

Public Class Methods

included(base) click to toggle source
# File lib/contract_value_object/awesome_print.rb, line 3
def self.included(base)
  base.send :alias_method, :cast_without_cvo, :cast
  base.send :alias_method, :cast, :cast_with_cvo
end

Public Instance Methods

awesome_contract_value_object(object) click to toggle source
# File lib/contract_value_object/awesome_print.rb, line 16
def awesome_contract_value_object(object)
  "#{object.class} #{awesome_hash(object.to_h)}"
end
cast_with_cvo(object, type) click to toggle source
# File lib/contract_value_object/awesome_print.rb, line 8
def cast_with_cvo(object, type)
  cast = cast_without_cvo(object, type)
  if (defined?(::ContractValueObject)) && (object.is_a?(::ContractValueObject))
    cast = :contract_value_object
  end
  cast
end