Class: Ippon::Form::StringField
Instance Attribute Summary
Attributes inherited from Field
Instance Method Summary collapse
- #fill_from_data(data, key) ⇒ Object
-
#initialize ⇒ StringField
constructor
A new instance of StringField.
- #input=(val) ⇒ Object
Methods inherited from Field
Constructor Details
#initialize ⇒ StringField
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 |