Class: NilClass
Instance Method Summary collapse
-
#not_nil!(message = nil) ⇒ Object
Raises
NotNilable::NilAssertionError.
Instance Method Details
#not_nil!(message = nil) ⇒ Object
Raises NotNilable::NilAssertionError.
This method asserts that the receiver is not nil. Since the receiver is nil, the assertion fails and an exception is raised. An optional message may be supplied to customize the exception message.
11 12 13 |
# File 'lib/not_nilable/core_ext/nil_class.rb', line 11 def not_nil!( = nil) #: bot raise NotNilable::NilAssertionError, || "Nil assertion failed" end |