Class: Hall::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/hall.rb

Instance Method Summary collapse

Constructor Details

#initialize(room_token, integration_name) ⇒ Client

Returns a new instance of Client.



10
11
12
13
# File 'lib/hall.rb', line 10

def initialize(room_token, integration_name)
  @room_token = room_token
  @integration_name = integration_name
end

Instance Method Details

#post_message(text) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/hall.rb', line 15

def post_message(text)
  body ={
    "title" => @integration_name,
    "message" => text
  }

  options = {body: body, options: { headers: { 'ContentType' => 'application/json' } } }

  self.class.post(room_path, options)
end