Class: Co2Notify::HipchatClient

Inherits:
Object
  • Object
show all
Defined in:
lib/co2-notify/hipchat_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ HipchatClient

Returns a new instance of HipchatClient.



5
6
7
8
# File 'lib/co2-notify/hipchat_client.rb', line 5

def initialize(config)
  @config = config
  @client = HipChat::Client.new(api_token, api_version: "v2")
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



2
3
4
# File 'lib/co2-notify/hipchat_client.rb', line 2

def client
  @client
end

#configObject (readonly)

Returns the value of attribute config.



2
3
4
# File 'lib/co2-notify/hipchat_client.rb', line 2

def config
  @config
end

Instance Method Details

#send(status) ⇒ Object



10
11
12
# File 'lib/co2-notify/hipchat_client.rb', line 10

def send(status)
  client[room].send("#{location}", status.message, color: status.color, message_format: "text")
end