Class: ActiveMessenger::Adapters::Hipchat

Inherits:
Base
  • Object
show all
Defined in:
lib/active_messenger/adapters/hipchat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

load_config!

Constructor Details

#initializeHipchat

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_idObject

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_nameObject

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