Class: NilClass
Instance Method Summary collapse
-
#cl_combine(*args) ⇒ Object
See the documenation for String#cl_combine.
-
#cl_not_nil? ⇒ Boolean
A simple helper to improve readability.
- #cl_to_yes_no(options = {}) ⇒ Object
Instance Method Details
#cl_combine(*args) ⇒ Object
See the documenation for String#cl_combine. This method exists so we can seamlessly call nil.cl_combine(“foo”) and get back “foo” (instead of an error).
14 15 16 |
# File 'lib/corelib_ruby/core_ext/nil/core.rb', line 14 def cl_combine(*args) "".cl_combine(*args) end |
#cl_not_nil? ⇒ Boolean
A simple helper to improve readability. [].cl_not_nil? reads better than ![].nil?
4 5 6 |
# File 'lib/corelib_ruby/core_ext/nil/core.rb', line 4 def cl_not_nil? false end |
#cl_to_yes_no(options = {}) ⇒ Object
8 9 10 |
# File 'lib/corelib_ruby/core_ext/nil/core.rb', line 8 def cl_to_yes_no(={}) .fetch(:if_nil, "") end |