Class: Tuiter::DirectMessage

Inherits:
DirectMessageBasic show all
Defined in:
lib/tuiter/data/direct_message.rb

Instance Attribute Summary collapse

Attributes inherited from DirectMessageBasic

#created_at, #id, #recipient_id, #recipient_screen_name, #sender_id, #sender_screen_name, #text

Instance Method Summary collapse

Constructor Details

#initialize(data = nil) ⇒ DirectMessage

Returns a new instance of DirectMessage.



33
34
35
36
37
38
39
# File 'lib/tuiter/data/direct_message.rb', line 33

def initialize(data = nil)
  unless data.nil?
    super(data)
    @sender = User.new(data['sender'])
    @recipient = User.new(data['recipient'])
  end
end

Instance Attribute Details

#recipientObject

Returns the value of attribute recipient.



31
32
33
# File 'lib/tuiter/data/direct_message.rb', line 31

def recipient
  @recipient
end

#senderObject

Returns the value of attribute sender.



30
31
32
# File 'lib/tuiter/data/direct_message.rb', line 30

def sender
  @sender
end