Class: Boolean
Instance Method Summary collapse
- #! ⇒ Object
- #&(other) ⇒ Object
- #==(other) ⇒ Object (also: #equal?, #eql?)
- #^(other) ⇒ Object
- #__id__ ⇒ Object (also: #object_id)
- #clone ⇒ Object
- #dup ⇒ Object
- #singleton_class ⇒ Object
- #to_s ⇒ Object
- #|(other) ⇒ Object
Instance Method Details
#! ⇒ Object
11 12 13 |
# File 'opal/opal/corelib/boolean.rb', line 11 def ! `self != true` end |
#&(other) ⇒ Object
15 16 17 |
# File 'opal/opal/corelib/boolean.rb', line 15 def &(other) `(self == true) ? (other !== false && other !== nil) : false` end |
#==(other) ⇒ Object Also known as: equal?, eql?
27 28 29 |
# File 'opal/opal/corelib/boolean.rb', line 27 def ==(other) `(self == true) === other.valueOf()` end |
#^(other) ⇒ Object
23 24 25 |
# File 'opal/opal/corelib/boolean.rb', line 23 def ^(other) `(self == true) ? (other === false || other === nil) : (other !== false && other !== nil)` end |
#__id__ ⇒ Object Also known as: object_id
5 6 7 |
# File 'opal/opal/corelib/boolean.rb', line 5 def __id__ `self.valueOf() ? 2 : 0` end |
#clone ⇒ Object
46 47 48 |
# File 'opal/opal/corelib/boolean.rb', line 46 def clone raise TypeError, "can't clone #{self.class}" end |
#dup ⇒ Object
42 43 44 |
# File 'opal/opal/corelib/boolean.rb', line 42 def dup raise TypeError, "can't dup #{self.class}" end |
#singleton_class ⇒ Object
34 35 36 |
# File 'opal/opal/corelib/boolean.rb', line 34 def singleton_class Boolean end |
#to_s ⇒ Object
38 39 40 |
# File 'opal/opal/corelib/boolean.rb', line 38 def to_s `(self == true) ? 'true' : 'false'` end |
#|(other) ⇒ Object
19 20 21 |
# File 'opal/opal/corelib/boolean.rb', line 19 def |(other) `(self == true) ? true : (other !== false && other !== nil)` end |