Class: FactoryForm::Boolean

Inherits:
Field
  • Object
show all
Defined in:
lib/factoryform/boolean.rb

Instance Attribute Summary collapse

Attributes inherited from Field

#field_type, #hint, #id, #label, #required, #unique, #validation_format

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Boolean

Returns a new instance of Boolean.



5
6
7
8
9
10
11
12
13
14
# File 'lib/factoryform/boolean.rb', line 5

def initialize(options={})
  self.values = options[:values] = [true, false]
  options[:field_type] = "boolean"

  super(options)
  
  # Unique is always false
  self.unique = false

end

Instance Attribute Details

#valuesObject

True/false values



3
4
5
# File 'lib/factoryform/boolean.rb', line 3

def values
  @values
end