Class: AWeber::Resources::Account

Inherits:
AWeber::Resource show all
Defined in:
lib/aweber/resources/account.rb

Instance Attribute Summary

Attributes inherited from AWeber::Resource

#parent

Instance Method Summary collapse

Methods inherited from AWeber::Resource

#<=>, alias_attribute, api_attr, basepath, #delete, has_many, has_one, #initialize, #inspect, #path, #save, #uri, #writable_attrs

Constructor Details

This class inherits a constructor from AWeber::Resource

Instance Method Details

#find_subscribers(params = {}) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/aweber/resources/account.rb', line 15

def find_subscribers(params={})
  params   = params.map { |k,v| "#{h(k)}=#{h(v)}" }.join("&")
  uri      = "#{path}?ws.op=findSubscribers&#{params}"
  response = client.get(uri).merge(:parent => self)
  response["total_size"] ||= response["entries"].size

  Collection.new(client, Subscriber, response)
end

#web_form_split_testsObject



31
32
33
34
35
36
# File 'lib/aweber/resources/account.rb', line 31

def web_form_split_tests
  uri = "#{path}?ws.op=getWebFormSplitTests"
  response = client.get(uri)
  
  response.map { |split_test| WebFormSplitTest.new(client, split_test) }
end

#web_formsObject



24
25
26
27
28
29
# File 'lib/aweber/resources/account.rb', line 24

def web_forms
  uri = "#{path}?ws.op=getWebForms"
  response = client.get(uri)
  
  response.map { |webform| WebForm.new(client, webform) }
end