Class: Tuiter::DirectMessageBasic
- Inherits:
-
Object
- Object
- Tuiter::DirectMessageBasic
- Defined in:
- lib/tuiter/data/direct_message.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#recipient_id ⇒ Object
Returns the value of attribute recipient_id.
-
#recipient_screen_name ⇒ Object
Returns the value of attribute recipient_screen_name.
-
#sender_id ⇒ Object
Returns the value of attribute sender_id.
-
#sender_screen_name ⇒ Object
Returns the value of attribute sender_screen_name.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(data = nil) ⇒ DirectMessageBasic
constructor
A new instance of DirectMessageBasic.
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_at ⇒ Object
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 |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/tuiter/data/direct_message.rb', line 4 def id @id end |
#recipient_id ⇒ Object
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_name ⇒ Object
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_id ⇒ Object
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_name ⇒ Object
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 |
#text ⇒ Object
Returns the value of attribute text.
5 6 7 |
# File 'lib/tuiter/data/direct_message.rb', line 5 def text @text end |