Class: Txbr::CampaignHandler
- Inherits:
-
Object
- Object
- Txbr::CampaignHandler
- Defined in:
- lib/txbr/campaign_handler.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #each_campaign ⇒ Object (also: #each_item)
- #each_resource(&block) ⇒ Object
-
#initialize(project) ⇒ CampaignHandler
constructor
A new instance of CampaignHandler.
Constructor Details
#initialize(project) ⇒ CampaignHandler
Returns a new instance of CampaignHandler.
5 6 7 |
# File 'lib/txbr/campaign_handler.rb', line 5 def initialize(project) @project = project end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
3 4 5 |
# File 'lib/txbr/campaign_handler.rb', line 3 def project @project end |
Instance Method Details
#each_campaign ⇒ Object Also known as: each_item
14 15 16 17 18 19 20 |
# File 'lib/txbr/campaign_handler.rb', line 14 def each_campaign return to_enum(__method__) unless block_given? project.braze_api.campaigns.each do |campaign_data| yield Campaign.new(project, campaign_data) end end |
#each_resource(&block) ⇒ Object
9 10 11 12 |
# File 'lib/txbr/campaign_handler.rb', line 9 def each_resource(&block) return to_enum(__method__) unless block_given? each_campaign { |campaign| campaign.each_resource(&block) } end |