Class: ActiveMessenger::Adapters::Slack
- Defined in:
- lib/active_messenger/adapters/slack.rb
Instance Method Summary collapse
- #channnel=(ch) ⇒ Object
-
#initialize ⇒ Slack
constructor
A new instance of Slack.
- #send!(msg) ⇒ Object
- #username=(u_name) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize ⇒ Slack
Returns a new instance of Slack.
11 12 13 14 15 16 17 |
# File 'lib/active_messenger/adapters/slack.rb', line 11 def initialize @client = ::Slack::Notifier.new( self.class.webhook_url, channel: self.class.channel, username: self.class.username ) end |
Instance Method Details
#channnel=(ch) ⇒ Object
19 20 21 |
# File 'lib/active_messenger/adapters/slack.rb', line 19 def channnel=(ch) @client.channel = ch end |
#send!(msg) ⇒ Object
27 28 29 |
# File 'lib/active_messenger/adapters/slack.rb', line 27 def send!(msg) @client.ping(msg) end |
#username=(u_name) ⇒ Object
23 24 25 |
# File 'lib/active_messenger/adapters/slack.rb', line 23 def username=(u_name) @client.username = u_name end |