Class: Wufoo::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/wufoo/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, api_key) ⇒ Client

Returns a new instance of Client.



7
8
9
# File 'lib/wufoo/client.rb', line 7

def initialize(url, api_key)
  @url, @api_key = url, api_key
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



5
6
7
# File 'lib/wufoo/client.rb', line 5

def api_key
  @api_key
end

#urlObject

Returns the value of attribute url.



5
6
7
# File 'lib/wufoo/client.rb', line 5

def url
  @url
end

Instance Method Details

#post(path, data) ⇒ Object



11
12
13
14
15
16
# File 'lib/wufoo/client.rb', line 11

def post(path, data)
  data.merge!({
    :w_api_key => api_key,
  })
  self.class.post("#{@url}#{path}", :query => data, :format => :json)
end