Module: Remind101::Client::Messages
Instance Method Summary collapse
-
#create_message!(hash) ⇒ Object
(also: #send_message!)
Public: Creates a new message.
-
#destroy_message!(message_id) ⇒ Object
(also: #cancel_message!)
Public: Destroy an existing message.
-
#messages ⇒ Object
Public: Returns all messages for the current user.
Methods included from Rescuable
Instance Method Details
#create_message!(hash) ⇒ Object Also known as: send_message!
Public: Creates a new message.
Also aliased as ‘#send_message!`.
Examples
remind101. body: 'Hello World!', group_ids: [1234]
# => { :id => 4321, :body => "Hello World!", :group_ids => [1234], ... }
Returns the created message.
26 27 28 |
# File 'lib/remind101/client/messages.rb', line 26 def (hash) api_post('/messages', message: hash).body end |
#destroy_message!(message_id) ⇒ Object Also known as: cancel_message!
Public: Destroy an existing message.
Also aliased as ‘cancel_message!`.
Examples
remind101. 4321
# => { :id => 4321, :body => "Hello World!", :group_ids => [1234], ... }
Returns the destroyed message.
43 44 45 |
# File 'lib/remind101/client/messages.rb', line 43 def () api_delete("/messages/#{message_id}").body end |
#messages ⇒ Object
Public: Returns all messages for the current user.
Examples
remind101.
# => [{ ... }]
Returns an Array of all messages.
12 13 14 |
# File 'lib/remind101/client/messages.rb', line 12 def api_get('/messages').body end |