Class: Txbr::Campaign
- Inherits:
-
Object
- Object
- Txbr::Campaign
- Defined in:
- lib/txbr/campaign.rb
Constant Summary collapse
- ITEM_TYPE =
'campaign'.freeze
- TEMPLATE_KEYS =
%w(body subject preheader message alert).freeze
Instance Attribute Summary collapse
-
#campaign_id ⇒ Object
readonly
Returns the value of attribute campaign_id.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #each_resource(&block) ⇒ Object
-
#initialize(project, campaign_id) ⇒ Campaign
constructor
A new instance of Campaign.
- #metadata ⇒ Object
Constructor Details
#initialize(project, campaign_id) ⇒ Campaign
Returns a new instance of Campaign.
10 11 12 13 |
# File 'lib/txbr/campaign.rb', line 10 def initialize(project, campaign_id) @project = project @campaign_id = campaign_id end |
Instance Attribute Details
#campaign_id ⇒ Object (readonly)
Returns the value of attribute campaign_id.
8 9 10 |
# File 'lib/txbr/campaign.rb', line 8 def campaign_id @campaign_id end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
8 9 10 |
# File 'lib/txbr/campaign.rb', line 8 def project @project end |
Instance Method Details
#each_resource(&block) ⇒ Object
15 16 17 18 |
# File 'lib/txbr/campaign.rb', line 15 def each_resource(&block) return to_enum(__method__) unless block_given? template_group.each_resource(&block) end |
#metadata ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/txbr/campaign.rb', line 20 def ||= { item_type: ITEM_TYPE, campaign_name: campaign_name, campaign_id: campaign_id } rescue => e {} end |