Class: Tootsie::Tasks::NotifyTask
- Inherits:
-
Object
- Object
- Tootsie::Tasks::NotifyTask
- Defined in:
- lib/tootsie/tasks/notify_task.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #attributes ⇒ Object
- #execute! ⇒ Object
-
#initialize(attributes = {}) ⇒ NotifyTask
constructor
A new instance of NotifyTask.
Constructor Details
#initialize(attributes = {}) ⇒ NotifyTask
Returns a new instance of NotifyTask.
6 7 8 9 10 |
# File 'lib/tootsie/tasks/notify_task.rb', line 6 def initialize(attributes = {}) attributes = attributes.with_indifferent_access @url = attributes[:url] @message = attributes[:message] end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
22 23 24 |
# File 'lib/tootsie/tasks/notify_task.rb', line 22 def @message end |
#url ⇒ Object
Returns the value of attribute url.
21 22 23 |
# File 'lib/tootsie/tasks/notify_task.rb', line 21 def url @url end |
Instance Method Details
#attributes ⇒ Object
17 18 19 |
# File 'lib/tootsie/tasks/notify_task.rb', line 17 def attributes {:url => @url, :message => @message} end |
#execute! ⇒ Object
12 13 14 15 |
# File 'lib/tootsie/tasks/notify_task.rb', line 12 def execute! Application.get.logger.info "Notifying #{@url} with message: #{@message.inspect}" HTTPClient.new.post(@url, @message) end |