Module: Croudia::API::SecretMails
- Included in:
- Client
- Defined in:
- lib/croudia/api/secret_mails.rb
Instance Method Summary collapse
-
#destroy_secret_mail(id, params = {}) ⇒ Croudia::SecretMail
Destroy a secret mail.
-
#secret_mails(params = {}) ⇒ Array<Croudia::SecretMail>
Get incoming secret mails.
-
#secret_mails_sent(params = {}) ⇒ Array<Croudia::SecretMail>
Get outgoing secret mails.
-
#secret_photo(id) ⇒ String
Get an image attached to a secret mail.
-
#send_secret_mail(text, to_user = {}, params = {}) ⇒ Croudia::SecretMail
Send a new secret mail.
-
#send_secret_mail_with_media(text, to_user = {}, media = {}, params = {}) ⇒ Croudia::SecretMail
Send a new secret mail with media.
-
#show_secret_mail(id, params = {}) ⇒ Croudia::SecretMail
Get a secret mail.
Instance Method Details
#destroy_secret_mail(id, params = {}) ⇒ Croudia::SecretMail
Destroy a secret mail
83 84 85 86 |
# File 'lib/croudia/api/secret_mails.rb', line 83 def destroy_secret_mail(id, params={}) resp = post("/secret_mails/destroy/#{get_id(id)}.json", params) Croudia::SecretMail.new(resp) end |
#secret_mails(params = {}) ⇒ Array<Croudia::SecretMail>
Get incoming secret mails
14 15 16 17 |
# File 'lib/croudia/api/secret_mails.rb', line 14 def secret_mails(params={}) resp = get('/secret_mails.json', params) objects(Croudia::SecretMail, resp) end |
#secret_mails_sent(params = {}) ⇒ Array<Croudia::SecretMail>
Get outgoing secret mails
27 28 29 30 |
# File 'lib/croudia/api/secret_mails.rb', line 27 def secret_mails_sent(params={}) resp = get('/secret_mails/sent.json', params) objects(Croudia::SecretMail, resp) end |
#secret_photo(id) ⇒ String
Get an image attached to a secret mail
104 105 106 |
# File 'lib/croudia/api/secret_mails.rb', line 104 def secret_photo(id) get("/secret_mails/get_secret_photo/#{id}") end |
#send_secret_mail(text, to_user, params = {}) ⇒ Croudia::SecretMail #send_secret_mail(params = {}) ⇒ Croudia::SecretMail
Send a new secret mail
45 46 47 48 49 50 51 |
# File 'lib/croudia/api/secret_mails.rb', line 45 def send_secret_mail(text, to_user={}, params={}) merge_text!(params, text, :text) merge_user!(params, to_user) resp = post('/secret_mails/new.json', params) Croudia::SecretMail.new(resp) end |
#send_secret_mail_with_media(text, to_user, media, params = {}) ⇒ Croudia::SecretMail #send_secret_mail_with_media(params = {}) ⇒ Croudia::SecretMail
Send a new secret mail with media
68 69 70 71 72 73 74 75 |
# File 'lib/croudia/api/secret_mails.rb', line 68 def send_secret_mail_with_media(text, to_user={}, media={}, params={}) merge_text!(params, text, :text) merge_user!(params, to_user) merge_file!(params, media, :media) resp = post('/secret_mails/new_with_media.json') Croudia::SecretMail.new(resp) end |
#show_secret_mail(id, params = {}) ⇒ Croudia::SecretMail
Get a secret mail
94 95 96 97 |
# File 'lib/croudia/api/secret_mails.rb', line 94 def show_secret_mail(id, params={}) resp = get("/secret_mails/show/#{get_id(id)}.json", params) Croudia::SecretMail.new(resp) end |