Class: RakeSlack::Client
- Inherits:
-
Object
- Object
- RakeSlack::Client
- Defined in:
- lib/rake_slack/client.rb
Constant Summary collapse
- URL =
'https://slack.com/api/chat.postMessage'
Instance Method Summary collapse
-
#initialize(bot_token) ⇒ Client
constructor
A new instance of Client.
- #post_message(payload) ⇒ Object
Constructor Details
#initialize(bot_token) ⇒ Client
Returns a new instance of Client.
12 13 14 |
# File 'lib/rake_slack/client.rb', line 12 def initialize(bot_token) @bot_token = bot_token end |
Instance Method Details
#post_message(payload) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/rake_slack/client.rb', line 16 def (payload) assert_ok(execute_post(payload)) rescue Excon::Error, SystemCallError, JSON::ParserError => e raise RakeSlack::Exceptions::DeliveryFailed, "Slack chat.postMessage failed: #{e.}" end |