Class: Tuiter::DirectMessageBasic

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

Direct Known Subclasses

DirectMessage

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = nil) ⇒ DirectMessageBasic

Returns a new instance of DirectMessageBasic.



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/tuiter/data/direct_message.rb', line 12

def initialize(data = nil)
  unless data.nil?
    @id = data['id']
    @text = data['text']
    @created_at = (data['created_at'] ? DateTime.parse(data['created_at']) : DateTime.now)
    @sender_id = data['sender_id']
    @sender_screen_name = data['sender_screen_name']
    @recipient_id = data['recipient_id']
    @recipient_screen_name = data['recipient_screen_name']
  else
    @created_at = DateTime.now
  end
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



6
7
8
# File 'lib/tuiter/data/direct_message.rb', line 6

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/tuiter/data/direct_message.rb', line 4

def id
  @id
end

#recipient_idObject

Returns the value of attribute recipient_id.



9
10
11
# File 'lib/tuiter/data/direct_message.rb', line 9

def recipient_id
  @recipient_id
end

#recipient_screen_nameObject

Returns the value of attribute recipient_screen_name.



10
11
12
# File 'lib/tuiter/data/direct_message.rb', line 10

def recipient_screen_name
  @recipient_screen_name
end

#sender_idObject

Returns the value of attribute sender_id.



7
8
9
# File 'lib/tuiter/data/direct_message.rb', line 7

def sender_id
  @sender_id
end

#sender_screen_nameObject

Returns the value of attribute sender_screen_name.



8
9
10
# File 'lib/tuiter/data/direct_message.rb', line 8

def sender_screen_name
  @sender_screen_name
end

#textObject

Returns the value of attribute text.



5
6
7
# File 'lib/tuiter/data/direct_message.rb', line 5

def text
  @text
end