Module: Redd::Client::Authenticated::PrivateMessages
- Included in:
- Redd::Client::Authenticated
- Defined in:
- lib/redd/client/authenticated/private_messages.rb
Instance Method Summary collapse
- #block_message(message) ⇒ Object
- #compose_message(to, subject, text, captcha = nil, identifier = nil) ⇒ Object
- #mark_as_read(message) ⇒ Object
- #mark_as_unread(message) ⇒ Object
- #messages(category = "inbox", params = {}) ⇒ Object
Instance Method Details
#block_message(message) ⇒ Object
5 6 7 8 |
# File 'lib/redd/client/authenticated/private_messages.rb', line 5 def () fullname = extract_fullname() post "/api/block", id: fullname end |
#compose_message(to, subject, text, captcha = nil, identifier = nil) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/redd/client/authenticated/private_messages.rb', line 10 def (to, subject, text, captcha = nil, identifier = nil) params = { api_type: "json", to: to.to_s, subject: subject, text: text } params << {captcha: captcha, iden: identifier} if captcha post "/api/compose", params end |
#mark_as_read(message) ⇒ Object
19 20 21 22 |
# File 'lib/redd/client/authenticated/private_messages.rb', line 19 def mark_as_read() fullname = extract_fullname() post "/api/read_message", id: fullname end |
#mark_as_unread(message) ⇒ Object
24 25 26 27 |
# File 'lib/redd/client/authenticated/private_messages.rb', line 24 def mark_as_unread() fullname = extract_fullname() post "/api/unread_message", id: fullname end |
#messages(category = "inbox", params = {}) ⇒ Object
29 30 31 |
# File 'lib/redd/client/authenticated/private_messages.rb', line 29 def (category = "inbox", params = {}) object_from_response :get, "/message/#{category}.json", params end |