Class: NilClass
- Defined in:
- opal/opal/corelib/nil.rb,
opal/opal/corelib/marshal/write_buffer.rb more...
Class Method Summary collapse
Instance Method Summary collapse
- #! ⇒ Object
- #&(other) ⇒ Object
- #==(other) ⇒ Object
- #^(other) ⇒ Object
- #__marshal__(buffer) ⇒ Object
- #clone(freeze: true) ⇒ Object
- #dup ⇒ Object
- #inspect ⇒ Object
- #instance_variables ⇒ Object
- #nil? ⇒ Boolean
- #rationalize(*args) ⇒ Object
- #singleton_class ⇒ Object
- #to_a ⇒ Object
- #to_c ⇒ Object
- #to_h ⇒ Object
- #to_i ⇒ Object (also: #to_f)
- #to_r ⇒ Object
- #to_s ⇒ Object
- #|(other) ⇒ Object
Class Method Details
.allocate ⇒ Object
5 6 7 |
# File 'opal/opal/corelib/nil.rb', line 5 def allocate raise TypeError, "allocator undefined for #{name}" end |
Instance Method Details
#&(other) ⇒ Object
[View source]
16 17 18 |
# File 'opal/opal/corelib/nil.rb', line 16 def &(other) false end |
#==(other) ⇒ Object
[View source]
28 29 30 |
# File 'opal/opal/corelib/nil.rb', line 28 def ==(other) `other === nil` end |
#^(other) ⇒ Object
[View source]
24 25 26 |
# File 'opal/opal/corelib/nil.rb', line 24 def ^(other) `other !== false && other !== nil` end |
#__marshal__(buffer) ⇒ Object
[View source]
2 3 4 |
# File 'opal/opal/corelib/marshal/write_buffer.rb', line 2 def __marshal__(buffer) buffer.append('0') end |
#clone(freeze: true) ⇒ Object
[View source]
36 37 38 |
# File 'opal/opal/corelib/nil.rb', line 36 def clone(freeze: true) nil end |
#inspect ⇒ Object
[View source]
40 41 42 |
# File 'opal/opal/corelib/nil.rb', line 40 def inspect 'nil' end |
#instance_variables ⇒ Object
[View source]
83 84 85 |
# File 'opal/opal/corelib/nil.rb', line 83 def instance_variables [] end |
#rationalize(*args) ⇒ Object
74 75 76 77 |
# File 'opal/opal/corelib/nil.rb', line 74 def rationalize(*args) raise ArgumentError if args.length > 1 Rational(0, 1) end |
#singleton_class ⇒ Object
[View source]
48 49 50 |
# File 'opal/opal/corelib/nil.rb', line 48 def singleton_class NilClass end |
#to_c ⇒ Object
[View source]
70 71 72 |
# File 'opal/opal/corelib/nil.rb', line 70 def to_c Complex.new(0, 0) end |
#to_h ⇒ Object
[View source]
56 57 58 |
# File 'opal/opal/corelib/nil.rb', line 56 def to_h `Opal.hash()` end |
#to_i ⇒ Object Also known as: to_f
[View source]
60 61 62 |
# File 'opal/opal/corelib/nil.rb', line 60 def to_i 0 end |
#to_r ⇒ Object
[View source]
79 80 81 |
# File 'opal/opal/corelib/nil.rb', line 79 def to_r Rational(0, 1) end |
#|(other) ⇒ Object
[View source]
20 21 22 |
# File 'opal/opal/corelib/nil.rb', line 20 def |(other) `other !== false && other !== nil` end |