Class: Compel::Builder::Boolean

Inherits:
Schema
  • Object
show all
Defined in:
lib/compel/builder/boolean.rb

Instance Attribute Summary

Attributes inherited from Schema

#options, #type

Instance Method Summary collapse

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

#initializeBoolean

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, options = {})
  Coercion.coerce!(value, Coercion::Boolean)

  build_option :is, value, options
end