Class: Boolean
- Defined in:
- opal/opal/corelib/boolean.rb,
opal/opal/corelib/marshal/write_buffer.rb
Class Method Summary collapse
Instance Method Summary collapse
- #! ⇒ Object
- #&(other) ⇒ Object
- #==(other) ⇒ Object (also: #equal?, #eql?)
- #^(other) ⇒ Object
- #__id__ ⇒ Object (also: #object_id)
- #__marshal__(buffer) ⇒ Object
- #clone(freeze: true) ⇒ Object
- #dup ⇒ Object
- #singleton_class ⇒ Object
- #to_s ⇒ Object
- #|(other) ⇒ Object
Class Method Details
Instance Method Details
#! ⇒ Object
19 20 21
# File 'opal/opal/corelib/boolean.rb', line 19 def ! `self != true` end
#&(other) ⇒ Object
23 24 25
# File 'opal/opal/corelib/boolean.rb', line 23 def &(other) `(self == true) ? (other !== false && other !== nil) : false` end
#==(other) ⇒ Object Also known as: equal?, eql?
35 36 37
# File 'opal/opal/corelib/boolean.rb', line 35 def ==(other) `(self == true) === other.valueOf()` end
#^(other) ⇒ Object
31 32 33
# File 'opal/opal/corelib/boolean.rb', line 31 def ^(other) `(self == true) ? (other === false || other === nil) : (other !== false && other !== nil)` end
#__id__ ⇒ Object Also known as: object_id
13 14 15
# File 'opal/opal/corelib/boolean.rb', line 13 def __id__ `self.valueOf() ? 2 : 0` end
#__marshal__(buffer) ⇒ Object
8 9 10 11 12 13 14
# File 'opal/opal/corelib/marshal/write_buffer.rb', line 8 def __marshal__(buffer) if `self` buffer.append('T') else buffer.append('F') end end
#clone(freeze: true) ⇒ Object
54 55 56
# File 'opal/opal/corelib/boolean.rb', line 54 def clone(freeze: true) self end
#dup ⇒ Object
50 51 52
# File 'opal/opal/corelib/boolean.rb', line 50 def dup self end
#singleton_class ⇒ Object
42 43 44
# File 'opal/opal/corelib/boolean.rb', line 42 def singleton_class Boolean end
#to_s ⇒ Object
46 47 48
# File 'opal/opal/corelib/boolean.rb', line 46 def to_s `(self == true) ? 'true' : 'false'` end
#|(other) ⇒ Object
27 28 29
# File 'opal/opal/corelib/boolean.rb', line 27 def |(other) `(self == true) ? true : (other !== false && other !== nil)` end