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, options = {}) ⇒ Object
Methods inherited from Schema
#build_option, #default_options, #default_value, human_name, #required?, #validate
Methods included from Common
#coerce_if_proc, #default, #if, #length, #max_length, #min_length, #required
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, options = {}) ⇒ Object
10 11 12 13 14 |
# File 'lib/compel/builder/boolean.rb', line 10 def is(value, = {}) Coercion.coerce!(value, Coercion::Boolean) build_option :is, value, end |