Class: Compel::Builder::Boolean
- Defined in:
- lib/compel/builder/boolean.rb
Instance Attribute Summary
Attributes inherited from Schema
Instance Method Summary collapse
-
#initialize ⇒ Boolean
constructor
A new instance of Boolean.
- #is(value) ⇒ Object
Methods inherited from Schema
#default_value, #required?, #validate
Methods included from Common
Constructor Details
#initialize ⇒ Boolean
Returns a new instance of Boolean.
6 7 8 |
# File 'lib/compel/builder/boolean.rb', line 6 def initialize super(Coercion::Boolean) end |
Instance Method Details
#is(value) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/compel/builder/boolean.rb', line 10 def is(value) Coercion.coerce!(value, Coercion::Boolean) [:is] = value self end |