Module: ChatWork::Message
- Defined in:
- lib/chatwork/message.rb
Class Method Summary collapse
-
.create(room_id:, body:, self_unread: false) {|response_body, response_header| ... } ⇒ Hashie::Mash
Add new message to the chat.
-
.destroy(room_id:, message_id:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Destroy the specified message.
-
.find(room_id:, message_id:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Get information about the specified message.
-
.get(room_id:, force: nil) {|response_body, response_header| ... } ⇒ Array<Hashie::Mash>
Get all messages associated with the specified chat (returns up to 100 entries).
-
.read(room_id:, message_id: nil) {|response_body, response_header| ... } ⇒ Hashie::Mash
Mark messages as read.
-
.unread(room_id:, message_id:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Mark messages as unread.
-
.update(room_id:, message_id:, body:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Update the specified message.
Class Method Details
.create(room_id:, body:, self_unread: false) {|response_body, response_header| ... } ⇒ Hashie::Mash
Add new message to the chat
56 57 58 |
# File 'lib/chatwork/message.rb', line 56 def self.create(room_id:, body:, self_unread: false, &block) ChatWork.client.(room_id: room_id, body: body, self_unread: self_unread, &block) end |
.destroy(room_id:, message_id:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Destroy the specified message
177 178 179 |
# File 'lib/chatwork/message.rb', line 177 def self.destroy(room_id:, message_id:, &block) ChatWork.client.(room_id: room_id, message_id: , &block) end |
.find(room_id:, message_id:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Get information about the specified message
132 133 134 |
# File 'lib/chatwork/message.rb', line 132 def self.find(room_id:, message_id:, &block) ChatWork.client.(room_id: room_id, message_id: , &block) end |
.get(room_id:, force: nil) {|response_body, response_header| ... } ⇒ Array<Hashie::Mash>
Get all messages associated with the specified chat (returns up to 100 entries).
If the parameter is not set, it returns the next 100 entries from previous call.
33 34 35 |
# File 'lib/chatwork/message.rb', line 33 def self.get(room_id:, force: nil, &block) ChatWork.client.(room_id: room_id, force: force, &block) end |
.read(room_id:, message_id: nil) {|response_body, response_header| ... } ⇒ Hashie::Mash
Mark messages as read
79 80 81 |
# File 'lib/chatwork/message.rb', line 79 def self.read(room_id:, message_id: nil, &block) ChatWork.client.(room_id: room_id, message_id: , &block) end |
.unread(room_id:, message_id:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Mark messages as unread
102 103 104 |
# File 'lib/chatwork/message.rb', line 102 def self.unread(room_id:, message_id:, &block) ChatWork.client.(room_id: room_id, message_id: , &block) end |
.update(room_id:, message_id:, body:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Update the specified message
155 156 157 |
# File 'lib/chatwork/message.rb', line 155 def self.update(room_id:, message_id:, body:, &block) ChatWork.client.(room_id: room_id, message_id: , body: body, &block) end |