Class: NdrDevSupport::SlackMessagePublisher
- Inherits:
-
Object
- Object
- NdrDevSupport::SlackMessagePublisher
- Defined in:
- lib/ndr_dev_support/slack_message_publisher.rb
Overview
This Class publishes messages to Slack
Instance Method Summary collapse
-
#initialize(url, default_options = {}) ⇒ SlackMessagePublisher
constructor
A new instance of SlackMessagePublisher.
- #post(options = {}) ⇒ Object
Constructor Details
#initialize(url, default_options = {}) ⇒ SlackMessagePublisher
Returns a new instance of SlackMessagePublisher.
6 7 8 9 |
# File 'lib/ndr_dev_support/slack_message_publisher.rb', line 6 def initialize(url, = {}) @url = url @default_options = end |
Instance Method Details
#post(options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ndr_dev_support/slack_message_publisher.rb', line 11 def post( = {}) request = json_request request.body = () use_ssl = request.uri.scheme == 'https' http = if proxy proxy.start(request.uri.host, use_ssl: use_ssl) else Net::HTTP.start(request.uri.host, request.uri.port, use_ssl: use_ssl) end http.request(request) end |