Class: LiquidBackup::Notifier::Talker
- Inherits:
-
Object
- Object
- LiquidBackup::Notifier::Talker
- Defined in:
- lib/liquid_backup/notifier/talker_notifier.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Talker
constructor
A new instance of Talker.
- #notify(message = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Talker
Returns a new instance of Talker.
4 5 6 7 8 |
# File 'lib/liquid_backup/notifier/talker_notifier.rb', line 4 def initialize(={}) @token = [:api_token] @subdomain = [:subdomain] @default_room = [:default_room] end |
Instance Method Details
#notify(message = {}) ⇒ Object
10 11 12 |
# File 'lib/liquid_backup/notifier/talker_notifier.rb', line 10 def notify(={}) `curl -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Talker-Token: #{@token}' -d '{"message":"#{[:body]}"}' https://#{@subdomain}.talkerapp.com/rooms/#{[:room] || @default_room}/messages.json` end |