Sha256: 41d8084cc370b03c9aee3ce9fed90850ec1c427ea7da47dbc1becf473b89b9c8
Contents?: true
Size: 381 Bytes
Versions: 2
Compression:
Stored size: 381 Bytes
Contents
require 'json' require 'net/http' module SlackWeb def self.call(options) options.fetch(:token) method = options.fetch(:method) fail unless method.match(/^[a-z]+\.[A-z]+$/) options.delete(:method) api_url = options[:slack_api_url] || 'https://slack.com/api' req = Net::HTTP.post_form URI(api_url + '/' + method), options JSON.parse req.body end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
slack-rtmapi2-2.0.2 | lib/slack_web.rb |
slack-rtmapi2-2.0.1 | lib/slack_web.rb |