Class: Stealth::Server
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Stealth::Server
- Defined in:
- lib/stealth-webhook/overriding/server.rb
Instance Method Summary collapse
Instance Method Details
#send_message(params, auth_token = nil) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/stealth-webhook/overriding/server.rb', line 18 def (params, auth_token = nil) return [401, 'Unauthorized: Invalid Token'] if ENV['WEHBOOK_AUTH_TOKEN'] && auth_token != "Token #{ENV['WEHBOOK_AUTH_TOKEN']}" begin webhook = StealthWebhook::Webhook.new webhook.(params) rescue => e [503, "Service Unavailable: #{e.}"] end end |