Class: AWeber::Resources::List
- Inherits:
-
AWeber::Resource
- Object
- AWeber::Resource
- AWeber::Resources::List
- Defined in:
- lib/aweber/resources/list.rb
Constant Summary collapse
- FOLLOWUP_TYPE_LINK =
File.join(AWeber.api_url, "#followup_campaign")
- BROADCAST_TYPE_LINK =
File.join(AWeber.api_url, "#broadcast_campaign")
Instance Attribute Summary
Attributes inherited from AWeber::Resource
Instance Method Summary collapse
- #broadcasts ⇒ Object
- #followups ⇒ Object
-
#initialize(*args) ⇒ List
constructor
A new instance of List.
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
#broadcasts ⇒ Object
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 |
#followups ⇒ Object
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 |