Sha256: d7b2a85fb83d5243b5ddef8c4f0089ec7f932a5914bea01048099b736bfc045a
Contents?: true
Size: 605 Bytes
Versions: 6
Compression:
Stored size: 605 Bytes
Contents
class Boolean < `Boolean` %x{ Boolean.prototype._isBoolean = true; } def &(other) `(#{self} == true) ? (other !== false && other !== nil) : false` end def |(other) `(#{self} == true) ? true : (other !== false && other !== nil)` end def ^(other) `(#{self} == true) ? (other === false || other === nil) : (other !== false && other !== nil)` end def ==(other) `(#{self} == true) === other.valueOf()` end alias singleton_class class def to_json `(#{self} == true) ? 'true' : 'false'` end def to_s `(#{self} == true) ? 'true' : 'false'` end end
Version data entries
6 entries across 6 versions & 1 rubygems