Class: AWeber::Resources::List

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

Constant Summary collapse

File.join(AWeber.api_url, "#followup_campaign")
File.join(AWeber.api_url, "#broadcast_campaign")

Instance Method Summary collapse

Methods inherited from AWeber::Resource

#<=>, alias_attribute, api_attr, #delete, has_many, has_one, #save, #writable_attrs

Constructor Details

#initialize(*args) ⇒ List

Returns a new instance of List.



18
19
20
21
22
23
# File 'lib/aweber/resources/list.rb', line 18

def initialize(*args)
  super(*args)
  @campaigns  = {}
  @followups  = nil
  @broadcasts = nil
end

Instance Method Details

#broadcastsObject



33
34
35
36
# File 'lib/aweber/resources/list.rb', line 33

def broadcasts
  campaigns if @broadcasts.nil?
  @broadcasts
end

#campaignsObject



25
26
27
28
29
30
31
# File 'lib/aweber/resources/list.rb', line 25

def campaigns
  return @campaigns unless @campaigns == {}
  create_followups
  create_broadcasts
  populate_campaigns
  @campaigns
end

#followupsObject



38
39
40
41
# File 'lib/aweber/resources/list.rb', line 38

def followups
  campaigns if @followups.nil?
  @followups
end