Class: ChatworkTo::Notifiers::Slack
- Inherits:
-
Object
- Object
- ChatworkTo::Notifiers::Slack
- Defined in:
- lib/chatwork_to/notifiers/slack.rb
Instance Method Summary collapse
- #info(message) ⇒ Object
-
#initialize(opts = {}) ⇒ Slack
constructor
A new instance of Slack.
- #notify(hash) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Slack
Returns a new instance of Slack.
6 7 8 9 10 |
# File 'lib/chatwork_to/notifiers/slack.rb', line 6 def initialize(opts = {}) @debug = !!opts.delete('debug') build_uri build_default_query(opts) end |
Instance Method Details
#info(message) ⇒ Object
19 20 21 |
# File 'lib/chatwork_to/notifiers/slack.rb', line 19 def info() exec_notify(post_request(text: decorate())) end |
#notify(hash) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/chatwork_to/notifiers/slack.rb', line 12 def notify(hash) hash['chat_list'].each do |chat| text, = request_body(chat, hash['room'], hash['users']) exec_notify(post_request(text: text, attachment: )) end end |