Class: Resourceful::AbstractFormData
- Defined in:
- lib/resourceful/abstract_form_data.rb
Direct Known Subclasses
Instance Method Summary collapse
- #add(name, value) ⇒ Object
-
#initialize(contents = {}) ⇒ AbstractFormData
constructor
A new instance of AbstractFormData.
Constructor Details
#initialize(contents = {}) ⇒ AbstractFormData
Returns a new instance of AbstractFormData.
3 4 5 6 7 8 9 |
# File 'lib/resourceful/abstract_form_data.rb', line 3 def initialize(contents = {}) @form_data = [] contents.each do |k,v| add(k, v) end end |
Instance Method Details
#add(name, value) ⇒ Object
11 12 13 |
# File 'lib/resourceful/abstract_form_data.rb', line 11 def add(name, value) form_data << [name.to_s, value] end |