Class: Ippon::Form::BooleanField

Inherits:
Field
  • Object
show all
Defined in:
lib/ippon/form.rb

Instance Attribute Summary

Attributes inherited from Field

#error, #input, #output

Instance Method Summary collapse

Methods inherited from Field

#each_param

Constructor Details

#initializeBooleanField

Returns a new instance of BooleanField.



50
51
52
# File 'lib/ippon/form.rb', line 50

def initialize
  @input = false
end

Instance Method Details

#fill_from_data(data, key) ⇒ Object



54
55
56
57
# File 'lib/ippon/form.rb', line 54

def fill_from_data(data, key)
  @input = !!data[key]
  self
end