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
14 15 16 |
# File 'opal/opal/corelib/nil.rb', line 14 def ! true end |
#&(other) ⇒ Object
18 19 20 |
# File 'opal/opal/corelib/nil.rb', line 18 def &(other) false end |
#==(other) ⇒ Object
30 31 32 |
# File 'opal/opal/corelib/nil.rb', line 30 def ==(other) `other === nil` end |
#^(other) ⇒ Object
26 27 28 |
# File 'opal/opal/corelib/nil.rb', line 26 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
38 39 40 |
# File 'opal/opal/corelib/nil.rb', line 38 def clone(freeze: true) nil end |
#dup ⇒ Object
34 35 36 |
# File 'opal/opal/corelib/nil.rb', line 34 def dup nil end |
#inspect ⇒ Object
42 43 44 |
# File 'opal/opal/corelib/nil.rb', line 42 def inspect 'nil' end |
#instance_variables ⇒ Object
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) ::Kernel.raise ::ArgumentError if args.length > 1 ::Kernel.Rational(0, 1) end |
#singleton_class ⇒ Object
50 51 52 |
# File 'opal/opal/corelib/nil.rb', line 50 def singleton_class ::NilClass end |
#to_a ⇒ Object
54 55 56 |
# File 'opal/opal/corelib/nil.rb', line 54 def to_a [] end |
#to_h ⇒ Object
58 59 60 |
# File 'opal/opal/corelib/nil.rb', line 58 def to_h `new Map()` end |
#to_i ⇒ Object Also known as: to_f
62 63 64 |
# File 'opal/opal/corelib/nil.rb', line 62 def to_i 0 end |
#to_r ⇒ Object
79 80 81 |
# File 'opal/opal/corelib/nil.rb', line 79 def to_r ::Kernel.Rational(0, 1) end |
#|(other) ⇒ Object
22 23 24 |
# File 'opal/opal/corelib/nil.rb', line 22 def |(other) `other !== false && other !== nil` end |