Class: NilClass
- Defined in:
- opal/opal/corelib/nil.rb,
opal/opal/corelib/marshal/write_buffer.rb
Overview
backtick_javascript: true
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
Instance Method Details
#! ⇒ Object
15 16 17 |
# File 'opal/opal/corelib/nil.rb', line 15 def ! true end |
#&(other) ⇒ Object
19 20 21 |
# File 'opal/opal/corelib/nil.rb', line 19 def &(other) false end |
#==(other) ⇒ Object
31 32 33 |
# File 'opal/opal/corelib/nil.rb', line 31 def ==(other) `other === nil` end |
#^(other) ⇒ Object
27 28 29 |
# File 'opal/opal/corelib/nil.rb', line 27 def ^(other) `other !== false && other !== nil` end |
#__marshal__(buffer) ⇒ Object
4 5 6 |
# File 'opal/opal/corelib/marshal/write_buffer.rb', line 4 def __marshal__(buffer) buffer.append('0') end |
#clone(freeze: true) ⇒ Object
39 40 41 |
# File 'opal/opal/corelib/nil.rb', line 39 def clone(freeze: true) nil end |
#dup ⇒ Object
35 36 37 |
# File 'opal/opal/corelib/nil.rb', line 35 def dup nil end |
#inspect ⇒ Object
43 44 45 |
# File 'opal/opal/corelib/nil.rb', line 43 def inspect 'nil' end |
#instance_variables ⇒ Object
84 85 86 |
# File 'opal/opal/corelib/nil.rb', line 84 def instance_variables [] end |
#rationalize(*args) ⇒ Object
75 76 77 78 |
# File 'opal/opal/corelib/nil.rb', line 75 def rationalize(*args) ::Kernel.raise ::ArgumentError if args.length > 1 ::Kernel.Rational(0, 1) end |
#singleton_class ⇒ Object
51 52 53 |
# File 'opal/opal/corelib/nil.rb', line 51 def singleton_class ::NilClass end |
#to_a ⇒ Object
55 56 57 |
# File 'opal/opal/corelib/nil.rb', line 55 def to_a [] end |
#to_h ⇒ Object
59 60 61 |
# File 'opal/opal/corelib/nil.rb', line 59 def to_h `new Map()` end |
#to_i ⇒ Object Also known as: to_f
63 64 65 |
# File 'opal/opal/corelib/nil.rb', line 63 def to_i 0 end |
#to_r ⇒ Object
80 81 82 |
# File 'opal/opal/corelib/nil.rb', line 80 def to_r ::Kernel.Rational(0, 1) end |
#|(other) ⇒ Object
23 24 25 |
# File 'opal/opal/corelib/nil.rb', line 23 def |(other) `other !== false && other !== nil` end |