Class: Convore::Message
Instance Attribute Summary
Attributes inherited from Base
#attributes, #password, #username
Instance Method Summary collapse
-
#delete_message(message_id) ⇒ Object
Delete a message.
-
#initialize(username, password) ⇒ Message
constructor
A new instance of Message.
-
#star_message(message_id) ⇒ Object
Star a message.
Methods inherited from Base
api, find, from_json, get_class, #method_missing
Constructor Details
#initialize(username, password) ⇒ Message
Returns a new instance of Message.
4 5 6 7 |
# File 'lib/convore/message.rb', line 4 def initialize(username, password) @username = username @password = password end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Convore::Base
Instance Method Details
#delete_message(message_id) ⇒ Object
Delete a message. You must be the creator of the message or a group admin in order to delete the message.
18 19 20 21 22 |
# File 'lib/convore/message.rb', line 18 def () if .integer? RestClient.post "https://#{@username}:#{@password}@convore.com/api/messages/#{}/delete.json", {} end end |
#star_message(message_id) ⇒ Object
Star a message. If the message has already been starred by this user, this endpoint will then unstar the message.
11 12 13 14 15 |
# File 'lib/convore/message.rb', line 11 def () if .integer? RestClient.post "https://#{@username}:#{@password}@convore.com/api/messages/#{}/star.json", {} end end |