Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/not_nilable/core_ext/object.rb
Instance Method Summary collapse
-
#not_nil!(message = nil) ⇒ Object
Returns
self.
Instance Method Details
#not_nil!(message = nil) ⇒ Object
Returns self.
This method asserts that the receiver is not nil. Since Object is not NilClass, the assertion succeeds and self is returned. The message parameter is accepted for API parity with NilClass#not_nil! but is ignored.
12 13 14 |
# File 'lib/not_nilable/core_ext/object.rb', line 12 def not_nil!( = nil) #: self # rubocop:disable Lint/UnusedMethodArgument self end |