class Object

Constants

WILDCARD_ZERO

Public Instance Methods

*(other;) click to toggle source
# File lib/sy/wildcard_zero.rb, line 8
def * other; other.class.zero end
+(other;) click to toggle source
# File lib/sy/wildcard_zero.rb, line 13
def + other; other end
-(other;) click to toggle source
# File lib/sy/wildcard_zero.rb, line 14
def - other; -other end
/(other) click to toggle source
# File lib/sy/wildcard_zero.rb, line 9
def / other
  self unless other.zero?
  fail ZeroDivisionError, "The divisor is zero! (#{other})"
end
==(other) click to toggle source
# File lib/sy/wildcard_zero.rb, line 21
def == other
  z = begin
        other.class.zero
      rescue NoMethodError
        return false
      end
  other == z
end
coerce(other;) click to toggle source
# File lib/sy/wildcard_zero.rb, line 15
def coerce other; return other, other.class.zero end
inspect() click to toggle source
# File lib/sy/wildcard_zero.rb, line 18
def inspect; to_s end
to_f() click to toggle source
# File lib/sy/wildcard_zero.rb, line 19
def to_f; 0.0 end
to_i() click to toggle source
# File lib/sy/wildcard_zero.rb, line 20
def to_i; 0 end
to_s() click to toggle source
# File lib/sy/wildcard_zero.rb, line 17
def to_s; "∅" end
zero?() click to toggle source
# File lib/sy/wildcard_zero.rb, line 16
def zero?; true end