Module: Croudia::Rest::SecretMails
- Included in:
- Client
- Defined in:
- lib/croudia/rest/secret_mails.rb
Instance Method Summary collapse
-
#delete_message(status) ⇒ Croudia::Object::SecretMail
Deletes the authenticating user’s sent message.
-
#message(status) ⇒ Croudia::Object::SecretMail
Returns a single message, specified by the id parameter.
-
#message_photo(status) ⇒ String
Returns the URI of the image that attached to message.
-
#new_message(params = {}) ⇒ Croudia::Object::SecretMail
Sends a new message to the specified user from the authenticating user.
-
#new_message_with_media(params = {}) ⇒ Croudia::Object::SecretMail
Sends a new message with image to the specified user from the authenticating user.
-
#received(params = {}) ⇒ Array<Croudia::Object::SecretMail>
Returns the 20 most recent direct messages sent to the authenticating user.
-
#sent(params = {}) ⇒ Array<Croudia::Object::SecretMail>
Returns the 20 most recent direct messages sent by the authenticating user.
Instance Method Details
#delete_message(status) ⇒ Croudia::Object::SecretMail
Deletes the authenticating user’s sent message.
71 72 73 74 |
# File 'lib/croudia/rest/secret_mails.rb', line 71 def (status) response = post("secret_mails/destroy/#{status.id}.json") Croudia::Object::SecretMail.new(response) end |
#message(status) ⇒ Croudia::Object::SecretMail
Returns a single message, specified by the id parameter.
81 82 83 84 |
# File 'lib/croudia/rest/secret_mails.rb', line 81 def (status) response = get("secret_mails/show/#{status.id}.json") Croudia::Object::SecretMail.new(response) end |
#message_photo(status) ⇒ String
Returns the URI of the image that attached to message.
91 92 93 |
# File 'lib/croudia/rest/secret_mails.rb', line 91 def (status) "https://api.croudia.com/secret_mails/get_secret_photo/#{status.id}.json" end |
#new_message(params = {}) ⇒ Croudia::Object::SecretMail
Sends a new message to the specified user from the authenticating user.
47 48 49 50 |
# File 'lib/croudia/rest/secret_mails.rb', line 47 def (params = {}) response = post('secret_mails/new.json', params) Croudia::Object::SecretMail.new(response) end |
#new_message_with_media(params = {}) ⇒ Croudia::Object::SecretMail
Sends a new message with image to the specified user from the authenticating user.
61 62 63 64 |
# File 'lib/croudia/rest/secret_mails.rb', line 61 def (params = {}) response = post('secret_mails/new_with_media.json', params) Croudia::Object::SecretMail.new(response) end |
#received(params = {}) ⇒ Array<Croudia::Object::SecretMail>
Returns the 20 most recent direct messages sent to the authenticating user.
16 17 18 19 20 21 |
# File 'lib/croudia/rest/secret_mails.rb', line 16 def received(params = {}) response = get('secret_mails.json', params) response.map do |sm| Croudia::Object::SecretMail.new(sm) end end |
#sent(params = {}) ⇒ Array<Croudia::Object::SecretMail>
Returns the 20 most recent direct messages sent by the authenticating user.
32 33 34 35 36 37 |
# File 'lib/croudia/rest/secret_mails.rb', line 32 def sent(params = {}) response = get('secret_mails/sent.json', params) response.map do |sm| Croudia::Object::SecretMail.new(sm) end end |