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 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, #inspect, #path, #save, #uri, #writable_attrs

Constructor Details

#initialize(*args) ⇒ List

Returns a new instance of List.



23
24
25
26
27
# File 'lib/aweber/resources/list.rb', line 23

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

Instance Method Details

#broadcastsObject



29
30
31
32
33
34
35
# File 'lib/aweber/resources/list.rb', line 29

def broadcasts
  return @broadcasts if @broadcasts

  @broadcasts = AWeber::Collection.new(client, Campaign, :parent => self)
  @broadcasts.entries = Hash[campaigns.select { |id, c| c.is_broadcast? }]
  @broadcasts
end

#followupsObject



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

def followups
  return @followups if @followups

  @followups = AWeber::Collection.new(client, Campaign, :parent => self)
  @followups.entries = Hash[campaigns.select { |id, c| c.is_followup? }]
  @followups
end