Class: Flock::Notifier

Inherits:
Object
  • Object
show all
Defined in:
lib/flock/notifier.rb,
lib/flock/notifier/version.rb,
lib/flock/notifier/connection.rb

Defined Under Namespace

Classes: Connection

Constant Summary collapse

SEND_MESSAGE_HOOK_BASE_URL =
'https://api.flock.com/hooks/sendMessage/'
VERSION =
"0.1.0"

Instance Method Summary collapse

Constructor Details

#initialize(webhook_uid) ⇒ Notifier

Returns a new instance of Notifier.



8
9
10
11
# File 'lib/flock/notifier.rb', line 8

def initialize webhook_uid
  endpoint    = SEND_MESSAGE_HOOK_BASE_URL + webhook_uid
  @connection = Connection.new endpoint
end

Instance Method Details

#ping(message) ⇒ Object



13
14
15
# File 'lib/flock/notifier.rb', line 13

def ping(message)
  @connection.post(message)
end