Method: FactoryForm::MultipleChoice#initialize

Defined in:
lib/factoryform/multiple_choice.rb

#initialize(options = {}) ⇒ MultipleChoice

Returns a new instance of MultipleChoice.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/factoryform/multiple_choice.rb', line 7

def initialize(options={})
  options[:field_type] ||=  "radio_button"
  super(options)

  # Unique is always false
  @unique = false
  
  if options[:values] && options[:values].length > 1
    @values = options[:values]
  else
    raise(ParameterExpectedException, "Missing option values (at least two)")
  end
  
  
  check_field_type
end