Class: DeployNotification
- Inherits:
-
Object
- Object
- DeployNotification
- Defined in:
- app/mailers/deploy_notification.rb
Instance Attribute Summary collapse
-
#deploy ⇒ Object
readonly
Returns the value of attribute deploy.
-
#deployer ⇒ Object
readonly
Returns the value of attribute deployer.
-
#maintainers ⇒ Object
readonly
Returns the value of attribute maintainers.
Instance Method Summary collapse
- #deliver! ⇒ Object
-
#initialize(deploy) ⇒ DeployNotification
constructor
A new instance of DeployNotification.
Constructor Details
#initialize(deploy) ⇒ DeployNotification
Returns a new instance of DeployNotification.
3 4 5 6 7 |
# File 'app/mailers/deploy_notification.rb', line 3 def initialize(deploy) @deploy = deploy @deployer = deploy.deployer @maintainers = deploy.project.maintainers end |
Instance Attribute Details
#deploy ⇒ Object (readonly)
Returns the value of attribute deploy.
9 10 11 |
# File 'app/mailers/deploy_notification.rb', line 9 def deploy @deploy end |
#deployer ⇒ Object (readonly)
Returns the value of attribute deployer.
9 10 11 |
# File 'app/mailers/deploy_notification.rb', line 9 def deployer @deployer end |
#maintainers ⇒ Object (readonly)
Returns the value of attribute maintainers.
9 10 11 |
# File 'app/mailers/deploy_notification.rb', line 9 def maintainers @maintainers end |
Instance Method Details
#deliver! ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/mailers/deploy_notification.rb', line 11 def deliver! = maintainers.map do |maintainer| ProjectNotification.maintainer_of_deploy(maintainer, deploy).deliver! end if we_know_who_triggered_the_deploy and it_wasnt_a_maintainer << ProjectNotification.maintainer_of_deploy(deployer, deploy).deliver! end end |