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

#default_value, #required?, #validate

Methods included from Common

#default, #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) ⇒ Object



10
11
12
13
14
15
# File 'lib/compel/builder/boolean.rb', line 10

def is(value)
  Coercion.coerce!(value, Coercion::Boolean)
  options[:is] = value

  self
end