Class: WebHookNotifier
- Inherits:
-
Object
- Object
- WebHookNotifier
- Defined in:
- lib/abt/notifiers/web_hook_notifier.rb
Instance Method Summary collapse
- #headers ⇒ Object
-
#initialize(notifier_details) ⇒ WebHookNotifier
constructor
A new instance of WebHookNotifier.
- #post(message) ⇒ Object
- #send_message(message) ⇒ Object
Constructor Details
#initialize(notifier_details) ⇒ WebHookNotifier
Returns a new instance of WebHookNotifier.
4 5 6 |
# File 'lib/abt/notifiers/web_hook_notifier.rb', line 4 def initialize(notifier_details) @url = notifier_details["url"] end |
Instance Method Details
#headers ⇒ Object
21 22 23 24 |
# File 'lib/abt/notifiers/web_hook_notifier.rb', line 21 def headers #coudl be added oauth token {'User-Agent' => "ABT Ruby Client"} end |
#post(message) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/abt/notifiers/web_hook_notifier.rb', line 13 def post() begin RestClient.post(@url, {:message=>}, headers) rescue RestClient::Exception => ex ex.inspect end end |
#send_message(message) ⇒ Object
8 9 10 11 |
# File 'lib/abt/notifiers/web_hook_notifier.rb', line 8 def () puts "sending_message #{}" post() end |