Class: Definition::Types::Nil
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #conform(value) ⇒ Object
-
#initialize ⇒ Nil
constructor
A new instance of Nil.
Methods inherited from Base
Constructor Details
#initialize ⇒ Nil
Returns a new instance of Nil.
8 9 10 |
# File 'lib/definition/types/nil.rb', line 8 def initialize super(:nil) end |
Instance Method Details
#conform(value) ⇒ Object
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 |