Class: Txbr::EmailTemplateHandler
- Inherits:
-
Object
- Object
- Txbr::EmailTemplateHandler
- Defined in:
- lib/txbr/email_template_handler.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #each_resource(&block) ⇒ Object
- #each_template ⇒ Object (also: #each_item)
-
#initialize(project) ⇒ EmailTemplateHandler
constructor
A new instance of EmailTemplateHandler.
Constructor Details
#initialize(project) ⇒ EmailTemplateHandler
Returns a new instance of EmailTemplateHandler.
5 6 7 |
# File 'lib/txbr/email_template_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/email_template_handler.rb', line 3 def project @project end |
Instance Method Details
#each_resource(&block) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/txbr/email_template_handler.rb', line 9 def each_resource(&block) return to_enum(__method__) unless block_given? each_template do |tmpl| tmpl.each_resource(&block) end end |
#each_template ⇒ Object Also known as: each_item
17 18 19 20 21 22 23 |
# File 'lib/txbr/email_template_handler.rb', line 17 def each_template return to_enum(__method__) unless block_given? project.braze_api.email_templates.each do |tmpl| yield EmailTemplate.new(project, tmpl['email_template_id']) end end |