Class: Definition::Types::Nil
- Inherits:
-
Base
- Object
- Base
- Definition::Types::Nil
show all
- Defined in:
- lib/definition/types/nil.rb
Instance Attribute Summary
Attributes inherited from Base
#context, #name
Instance Method Summary
collapse
Methods inherited from Base
#error_renderer, #explain
Constructor Details
#initialize ⇒ Nil
8
9
10
|
# File 'lib/definition/types/nil.rb', line 8
def initialize
super(:nil)
end
|
Instance Method Details
12
13
14
15
16
17
18
19
20
|
# File 'lib/definition/types/nil.rb', line 12
def conform(value)
if value.nil?
ConformResult.new(value)
else
ConformResult.new(value, errors: [
ConformError.new(self, "Did not pass test for nil")
])
end
end
|