Class: NilClass
- Inherits:
-
Object
- Object
- NilClass
- Defined in:
- documented/common/class_exts/nilclass.rb
Overview
Represents the NilClass, which is the class of the nil object.
This class provides methods that return nil or behave as if they are nil.
Instance Method Summary collapse
-
#+(val) ⇒ Object
Adds the nil object to another value.
-
#closed? ⇒ Boolean
Checks if the nil object is considered closed.
-
#dup ⇒ nil
Returns a duplicate of the nil object.
-
#method_missing(*_args) ⇒ nil
Handles calls to methods that do not exist on the nil object.
-
#split(*_val) ⇒ Array
Splits the nil object into an array.
-
#strip ⇒ String
Removes whitespace from the nil object.
-
#to_s ⇒ String
Converts the nil object to a string.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*_args) ⇒ nil
Handles calls to methods that do not exist on the nil object.
16 17 18 |
# File 'documented/common/class_exts/nilclass.rb', line 16 def method_missing(*_args) nil end |
Instance Method Details
#+(val) ⇒ Object
Adds the nil object to another value.
42 43 44 |
# File 'documented/common/class_exts/nilclass.rb', line 42 def +(val) val end |
#closed? ⇒ Boolean
Checks if the nil object is considered closed.
48 49 50 |
# File 'documented/common/class_exts/nilclass.rb', line 48 def closed? true end |
#dup ⇒ nil
Returns a duplicate of the nil object.
9 10 11 |
# File 'documented/common/class_exts/nilclass.rb', line 9 def dup nil end |
#split(*_val) ⇒ Array
Splits the nil object into an array.
23 24 25 |
# File 'documented/common/class_exts/nilclass.rb', line 23 def split(*_val) Array.new end |
#strip ⇒ String
Removes whitespace from the nil object.
35 36 37 |
# File 'documented/common/class_exts/nilclass.rb', line 35 def strip "" end |
#to_s ⇒ String
Converts the nil object to a string.
29 30 31 |
# File 'documented/common/class_exts/nilclass.rb', line 29 def to_s "" end |