Class: Wufoo::Submission

Inherits:
Object
  • Object
show all
Defined in:
lib/wufoo/submission.rb

Defined Under Namespace

Classes: FieldError, Response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, form, params = {}) ⇒ Submission

Returns a new instance of Submission.



5
6
7
8
9
# File 'lib/wufoo/submission.rb', line 5

def initialize(client, form, params={})
  @client = client
  @form = form
  @params = {}.merge(params || {})
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



3
4
5
# File 'lib/wufoo/submission.rb', line 3

def client
  @client
end

#formObject

Returns the value of attribute form.



3
4
5
# File 'lib/wufoo/submission.rb', line 3

def form
  @form
end

#paramsObject

Returns the value of attribute params.



3
4
5
# File 'lib/wufoo/submission.rb', line 3

def params
  @params
end

Instance Method Details

#add_params(new_params) ⇒ Object



11
12
13
14
# File 'lib/wufoo/submission.rb', line 11

def add_params(new_params)
  @params.merge!(new_params)
  self
end

#processObject



16
17
18
# File 'lib/wufoo/submission.rb', line 16

def process
  Response.new(@client.post('/api/insert/', params.merge({:w_form => form})))
end