Module: Redd::Clients::Base::Privatemessages

Included in:
Redd::Clients::Base
Defined in:
lib/redd/clients/base/privatemessages.rb

Overview

Methods that require the “privatemessages” scope

Instance Method Summary collapse

Instance Method Details

#my_messages(category = 'inbox', mark = false, params = {}) ⇒ Object

Return a listing of a user’s private messages.

Parameters:

  • category ("inbox", "unread", "sent") (defaults to: 'inbox')

    The category of messages to view.

  • mark (Boolean) (defaults to: false)

    Whether to remove the orangered from the user’s inbox.

  • params (Hash) (defaults to: {})

    A list of params to send with the request.

Options Hash (params):

  • :after (String)

    Return results after the given fullname.

  • :before (String)

    Return results before the given fullname.

  • :count (Integer) — default: 0

    The number of items already seen in the listing.

  • :limit (1..100) — default: 25

    The maximum number of things to return.



21
22
23
24
# File 'lib/redd/clients/base/privatemessages.rb', line 21

def my_messages(category = 'inbox', mark = false, params = {})
  params[:mark] = mark
  request_object(:get, "/message/#{category}.json", params)
end

#read_all_messagesObject

Mark all messages as read.



27
28
29
# File 'lib/redd/clients/base/privatemessages.rb', line 27

def read_all_messages
  post('/api/read_all_messages')
end