Class: Ippon::Form::StringField

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

#initializeStringField

Returns a new instance of StringField.



18
19
20
# File 'lib/ippon/form.rb', line 18

def initialize
  @input = ""
end

Instance Method Details

#fill_from_data(data, key) ⇒ Object



26
27
28
29
# File 'lib/ippon/form.rb', line 26

def fill_from_data(data, key)
  @input = data.fetch(key) { "" }
  self
end

#input=(val) ⇒ Object



22
23
24
# File 'lib/ippon/form.rb', line 22

def input=(val)
  @input = val.to_s
end