Class: Camille::Types::Boolean
- Defined in:
- lib/camille/types/boolean.rb
Instance Attribute Summary
Attributes inherited from BasicType
Instance Method Summary collapse
Methods inherited from BasicType
&, #&, [], #[], directly_instantiable?, inherited, #initialize, instance, #transform, |, #|
Constructor Details
This class inherits a constructor from Camille::BasicType
Instance Method Details
#check(value) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/camille/types/boolean.rb', line 4 def check value if value == false || value == true Camille::Checked.new(fingerprint, value) else Camille::TypeError.new("Expected boolean, got #{value.inspect}.") end end |
#literal ⇒ Object
12 13 14 |
# File 'lib/camille/types/boolean.rb', line 12 def literal "boolean" end |