Class: Co2Notify::HipchatClient
- Inherits:
-
Object
- Object
- Co2Notify::HipchatClient
- Defined in:
- lib/co2-notify/hipchat_client.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config) ⇒ HipchatClient
constructor
A new instance of HipchatClient.
- #send(status) ⇒ Object
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
#client ⇒ Object (readonly)
Returns the value of attribute client.
2 3 4 |
# File 'lib/co2-notify/hipchat_client.rb', line 2 def client @client end |
#config ⇒ Object (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., color: status.color, message_format: "text") end |