Class: GuardWebHookNotifier::Notifier

Inherits:
Guard::Notifier::Base
  • Object
show all
Defined in:
lib/guard-webhook-notifier/notifier.rb

Constant Summary collapse

DEFAULTS =
{
  user_agent: "GuardWebHookNotifier/#{VERSION}",
  url: "http://10.0.2.2:4001/",
  timeout: 1
}

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Notifier



13
14
15
16
# File 'lib/guard-webhook-notifier/notifier.rb', line 13

def initialize(opts = {})
  super
  @options = DEFAULTS.merge(opts)
end

Instance Method Details

#notify(message, opts = {}) ⇒ Object



18
19
20
21
# File 'lib/guard-webhook-notifier/notifier.rb', line 18

def notify(message, opts = {})
  super
  send(message, opts) rescue Faraday::Error
end