Class: NilClass
- Inherits:
-
Object
- Object
- NilClass
- Defined in:
- lib/common/class_exts/nilclass.rb
Overview
Carve out from lich.rbw extension to class Nilclass 2024-06-13
Instance Method Summary collapse
-
#+(val) ⇒ Object
Adds a value to the nil object.
-
#closed? ⇒ Boolean
Checks if the nil object is closed.
-
#dup ⇒ NilClass
Duplicates the nil object.
-
#method_missing(*_args) ⇒ NilClass
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) ⇒ NilClass
Handles calls to methods that do not exist on the nil object.
22 23 24 |
# File 'lib/common/class_exts/nilclass.rb', line 22 def method_missing(*_args) nil end |
Instance Method Details
#+(val) ⇒ Object
Adds a value to the nil object.
64 65 66 |
# File 'lib/common/class_exts/nilclass.rb', line 64 def +(val) val end |
#closed? ⇒ Boolean
Checks if the nil object is closed.
74 75 76 |
# File 'lib/common/class_exts/nilclass.rb', line 74 def closed? true end |
#dup ⇒ NilClass
Duplicates the nil object.
11 12 13 |
# File 'lib/common/class_exts/nilclass.rb', line 11 def dup nil end |
#split(*_val) ⇒ Array
Splits the nil object into an array.
33 34 35 |
# File 'lib/common/class_exts/nilclass.rb', line 33 def split(*_val) Array.new end |
#strip ⇒ String
Removes whitespace from the nil object.
53 54 55 |
# File 'lib/common/class_exts/nilclass.rb', line 53 def strip "" end |
#to_s ⇒ String
Converts the nil object to a string.
43 44 45 |
# File 'lib/common/class_exts/nilclass.rb', line 43 def to_s "" end |