Class: Resourceful::AbstractFormData

Inherits:
Object
  • Object
show all
Defined in:
lib/resourceful/abstract_form_data.rb

Direct Known Subclasses

MultipartFormData, UrlencodedFormData

Instance Method Summary collapse

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