Module: Tins::Null::Kernel
- Included in:
- Object
- Defined in:
- lib/tins/null.rb
Instance Method Summary collapse
- #null(value = nil) ⇒ Object (also: #Null)
- #null_plus(opts = {}) ⇒ Object (also: #NullPlus)
Instance Method Details
#null(value = nil) ⇒ Object Also known as: Null
60 61 62 |
# File 'lib/tins/null.rb', line 60 def null(value = nil) value.nil? ? Tins::NULL : value end |
#null_plus(opts = {}) ⇒ Object Also known as: NullPlus
66 67 68 69 70 71 72 73 74 |
# File 'lib/tins/null.rb', line 66 def null_plus(opts = {}) value = opts[:value] opts[:caller] = caller if respond_to?(:caller_locations, true) opts[:caller_locations] = caller_locations end value.nil? ? Tins::NullPlus.new(opts) : value end |