Class: ActiveMessenger::Adapters::Hipchat
- Defined in:
- lib/active_messenger/adapters/hipchat.rb
Instance Attribute Summary collapse
-
#room_id ⇒ Object
Returns the value of attribute room_id.
-
#user_name ⇒ Object
Returns the value of attribute user_name.
Instance Method Summary collapse
-
#initialize ⇒ Hipchat
constructor
A new instance of Hipchat.
- #send!(msg) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize ⇒ Hipchat
Returns a new instance of Hipchat.
12 13 14 15 16 |
# File 'lib/active_messenger/adapters/hipchat.rb', line 12 def initialize @client = ::HipChat::Client.new(self.class.api_token, api_version: 'v2') @room_id = self.class.room_id @user_name = self.class.user_name end |
Instance Attribute Details
#room_id ⇒ Object
Returns the value of attribute room_id.
10 11 12 |
# File 'lib/active_messenger/adapters/hipchat.rb', line 10 def room_id @room_id end |
#user_name ⇒ Object
Returns the value of attribute user_name.
10 11 12 |
# File 'lib/active_messenger/adapters/hipchat.rb', line 10 def user_name @user_name end |
Instance Method Details
#send!(msg) ⇒ Object
18 19 20 |
# File 'lib/active_messenger/adapters/hipchat.rb', line 18 def send!(msg) @client[@room_id].send(@user_name, msg) end |