tap/app/models/webhook.rb

25 lines
483 B
Ruby
Raw Normal View History

2015-04-04 01:44:28 +02:00
class Webhook
DEFAULT_USERNAME = "Tab"
attr_accessor :hook
def initialize(attributes = {})
options = {
channel: (attributes[:channel]),
username: (attributes[:username] || DEFAULT_USERNAME),
icon_url: attributes[:icon_url],
icon_emoji: attributes[:icon_emoji]
}
self.hook = Tarumi::Bot.new(
2015-04-04 01:47:02 +02:00
"zeuswpi",
2015-04-04 01:51:11 +02:00
Rails.application.secrets.zeus_token,
2015-04-04 01:44:28 +02:00
options
)
end
def ping(text)
self.hook.ping(text)
end
end