Class: GitAgent::Notification
- Inherits:
-
Object
- Object
- GitAgent::Notification
- Defined in:
- lib/git_agent/notification.rb
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
Instance Attribute Summary collapse
-
#diff ⇒ Object
readonly
Returns the value of attribute diff.
-
#homepage ⇒ Object
readonly
Returns the value of attribute homepage.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title, homepage = nil, diff = {}) ⇒ Notification
constructor
A new instance of Notification.
- #send! ⇒ Object
Constructor Details
#initialize(title, homepage = nil, diff = {}) ⇒ Notification
Returns a new instance of Notification.
25 26 27 28 29 30 31 |
# File 'lib/git_agent/notification.rb', line 25 def initialize(title, homepage = nil, diff = {}) assert_config! @title = title @diff = diff @homepage = homepage end |
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
7 8 9 |
# File 'lib/git_agent/notification.rb', line 7 def config @config end |
Instance Attribute Details
#diff ⇒ Object (readonly)
Returns the value of attribute diff.
23 24 25 |
# File 'lib/git_agent/notification.rb', line 23 def diff @diff end |
#homepage ⇒ Object (readonly)
Returns the value of attribute homepage.
23 24 25 |
# File 'lib/git_agent/notification.rb', line 23 def homepage @homepage end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
23 24 25 |
# File 'lib/git_agent/notification.rb', line 23 def title @title end |
Instance Method Details
#send! ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/git_agent/notification.rb', line 33 def send! mail = Mail.new mail.from = config[:sender_username] mail.to = config[:recipient_username] mail.subject = title mail.body = construct_body mail.content_type = 'text/html; charset=UTF-8' mail.deliver! end |