class Bearychat::Notifier
Constants
- VERSION
Attributes
payload[R]
webhook_url[R]
Public Class Methods
new(webhook_url, options = {})
click to toggle source
# File lib/bearychat-notifier.rb, line 12 def initialize(webhook_url, options = {}) @webhook_url = webhook_url @payload = options end
Public Instance Methods
channel()
click to toggle source
# File lib/bearychat-notifier.rb, line 24 def channel payload[:channel] end
channel=(channel)
click to toggle source
# File lib/bearychat-notifier.rb, line 28 def channel=(channel) payload[:channel] = channel end
ping(text, options = {})
click to toggle source
# File lib/bearychat-notifier.rb, line 17 def ping(text, options = {}) payload.merge!(options) payload.merge!(text: text) params = { payload: payload.to_json } HttpClient.post(webhook_url, params) end