Class: Redd::Models::PrivateMessage

Inherits:
LazyModel show all
Includes:
Inboxable, Replyable
Defined in:
lib/redd/models/private_message.rb

Overview

A private message

Instance Attribute Summary

Attributes inherited from BasicModel

#client

Instance Method Summary collapse

Methods included from Replyable

#reply

Methods included from Inboxable

#block, #mark_as_read, #mark_as_unread

Methods inherited from LazyModel

#force_load, #initialize, #method_missing, #respond_to_missing?, #to_h

Methods inherited from BasicModel

from_id, #initialize, #inspect, #method_missing, #respond_to_missing?, #to_ary, #to_h

Constructor Details

This class inherits a constructor from Redd::Models::LazyModel

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Redd::Models::LazyModel

Instance Method Details

#deleteObject

Delete the message from the user’s inbox.



15
16
17
# File 'lib/redd/models/private_message.rb', line 15

def delete
  @client.post('/api/del_msg', id: get_attribute(:name))
end

#mute_authorObject

Mute the author of the message.



20
21
22
# File 'lib/redd/models/private_message.rb', line 20

def mute_author
  @client.post('/api/mute_message_author', id: get_attribute(:name))
end

#unmute_authorObject

Unmute the author of the message.



25
26
27
# File 'lib/redd/models/private_message.rb', line 25

def unmute_author
  @client.post('/api/unmute_message_author', id: get_attribute(:name))
end