Module: Gitter::Client::Messages
- Included in:
- Gitter::Client
- Defined in:
- lib/gitter/client/messages.rb
Instance Method Summary collapse
- #messages(room_id, options = {}) ⇒ Object
- #send_message(message, room_id) ⇒ Object
- #update_message(message, room_id, chat_id) ⇒ Object
Instance Method Details
#messages(room_id, options = {}) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/gitter/client/messages.rb', line 8 def (room_id, ={}) = [] self.class.get("/rooms/#{room_id}/chatMessages", headers: @headers, query: ).each do || << Hashie::Mash.new() end end |
#send_message(message, room_id) ⇒ Object
16 17 18 |
# File 'lib/gitter/client/messages.rb', line 16 def (, room_id) Hashie::Mash.new(self.class.post("/rooms/#{room_id}/chatMessages", headers: @headers, body: { text: }.to_json )) end |
#update_message(message, room_id, chat_id) ⇒ Object
20 21 22 |
# File 'lib/gitter/client/messages.rb', line 20 def (, room_id, chat_id) Hashie::Mash.new(self.class.put("/rooms/#{room_id}/chatMessages/#{chat_id}", headers: @headers, body: { text: }.to_json )) end |