Class: Boolean

Inherits:
Object
  • Object
show all
Defined in:
opal/opal/corelib/boolean.rb

Instance Method Summary collapse

Instance Method Details

#!Object



13
14
15
# File 'opal/opal/corelib/boolean.rb', line 13

def !
  `self != true`
end

#&(other) ⇒ Object



17
18
19
# File 'opal/opal/corelib/boolean.rb', line 17

def &(other)
  `(self == true) ? (other !== false && other !== nil) : false`
end

#==(other) ⇒ Object Also known as: equal?



29
30
31
# File 'opal/opal/corelib/boolean.rb', line 29

def ==(other)
  `(self == true) === other.valueOf()`
end

#^(other) ⇒ Object



25
26
27
# File 'opal/opal/corelib/boolean.rb', line 25

def ^(other)
  `(self == true) ? (other === false || other === nil) : (other !== false && other !== nil)`
end

#__id__Object Also known as: object_id



4
5
6
# File 'opal/opal/corelib/boolean.rb', line 4

def __id__
  `self.valueOf() ? 2 : 0`
end

#to_sObject



37
38
39
# File 'opal/opal/corelib/boolean.rb', line 37

def to_s
  `(self == true) ? 'true' : 'false'`
end

#|(other) ⇒ Object



21
22
23
# File 'opal/opal/corelib/boolean.rb', line 21

def |(other)
  `(self == true) ? true : (other !== false && other !== nil)`
end