Method: Object#aT_equal
- Defined in:
- lib/y_support/typing/object/typing.rb
#aT_equal(other, what_is_receiver = y_inspect, what_is_other = nil) ⇒ Object
Fails with TypeError unless the receiver, according to #== method, is equal to the argument. Two more optional arguments customize the error message (receiver description and the description of the other object).
107 108 109 110 111 |
# File 'lib/y_support/typing/object/typing.rb', line 107 def aT_equal other, what_is_receiver=y_inspect, what_is_other=nil return self if self == other wo = what_is_other || "the prescribed value (#{other.y_inspect})" fail TypeError, "%s must be equal to %s".X!( [ what_is_receiver, wo ] ) end |