Class: Hall::Client
Instance Method Summary collapse
-
#initialize(room_token, from_name, from_picture = nil) ⇒ Client
constructor
Client initialization.
-
#post_message(text) ⇒ Object
Post a message.
Constructor Details
#initialize(room_token, from_name, from_picture = nil) ⇒ Client
Client initialization
Usage:
Hall::Client.new('room_token', 'from_name')
Parametrs:
room_token
-
token for your room grab it through the Add integration -> Other or hall.com/docs/integrations/generic/
from_name
-
defines the name used for message posting
from_picture
-
optional add picture to the post
25 26 27 28 29 |
# File 'lib/hall.rb', line 25 def initialize(room_token, from_name, from_picture = nil) @room_token = room_token @from_name = from_name @from_picture = from_picture end |
Instance Method Details
#post_message(text) ⇒ Object
Post a message.
Usage:
'plain text'
Parametrs:
text
-
plain text to be send to the chat
42 43 44 45 46 47 48 49 50 |
# File 'lib/hall.rb', line 42 def (text) body ={ "title" => @from_name, "picture" => @from_picture, "message" => text } self.class.post(room_path, (body)) end |