Class: Pupil::DirectMessage

Inherits:
Scheme
  • Object
show all
Defined in:
lib/pupil/schemes.rb

Instance Method Summary collapse

Methods inherited from Scheme

#initialize, #params

Methods included from Essentials

#get, #guess_parameter, #post, #serialize_parameter

Constructor Details

This class inherits a constructor from Pupil::Scheme

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Pupil::Scheme

Instance Method Details

#destroyHash

Delete direct message

Parameters:

  • dm_id (Fixnum)

    message id that you want to delete

Returns:

  • (Hash)

    response



183
184
185
186
187
188
189
190
# File 'lib/pupil/schemes.rb', line 183

def destroy()
  begin
    response = self.post("direct_messages/destroy/#{@element["id"]}.json")
  rescue
    return false
  end
  return response
end

#recipientObject



178
# File 'lib/pupil/schemes.rb', line 178

def recipient() Pupil::User.new(@element["recipient"], @access_token) rescue nil; end

#senderObject



177
# File 'lib/pupil/schemes.rb', line 177

def sender() Pupil::User.new(@element["sender"], @access_token) rescue nil; end