Class: Stannum::Constraints::Types::NilType
- Inherits:
-
Stannum::Constraints::Type
- Object
- Base
- Stannum::Constraints::Type
- Stannum::Constraints::Types::NilType
- Defined in:
- lib/stannum/constraints/types/nil_type.rb
Overview
A Nil type constraint asserts that the object is nil.
Constant Summary collapse
- NEGATED_TYPE =
The :type of the error generated for a matching object.
'stannum.constraints.types.is_nil'
- TYPE =
The :type of the error generated for a non-matching object.
'stannum.constraints.types.is_not_nil'
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(**options) ⇒ NilType
constructor
A new instance of NilType.
Methods inherited from Stannum::Constraints::Type
#errors_for, #expected_type, #matches?, #negated_errors_for, #with_options
Methods included from Support::Optional
#optional?, #required?, resolve
Methods inherited from Base
#==, #clone, #does_not_match?, #dup, #errors_for, #match, #matches?, #message, #negated_errors_for, #negated_match, #negated_message, #negated_type, #type, #with_options
Constructor Details
#initialize(**options) ⇒ NilType
Returns a new instance of NilType.
16 17 18 |
# File 'lib/stannum/constraints/types/nil_type.rb', line 16 def initialize(**) super(::NilClass, **) end |