Class: Tuiter::StatusBasic
- Inherits:
-
Object
- Object
- Tuiter::StatusBasic
- Defined in:
- lib/tuiter/data/status.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#favorited ⇒ Object
Returns the value of attribute favorited.
-
#id ⇒ Object
Returns the value of attribute id.
-
#in_reply_to_screen_name ⇒ Object
Returns the value of attribute in_reply_to_screen_name.
-
#in_reply_to_status_id ⇒ Object
Returns the value of attribute in_reply_to_status_id.
-
#in_reply_to_user_id ⇒ Object
Returns the value of attribute in_reply_to_user_id.
-
#source ⇒ Object
Returns the value of attribute source.
-
#text ⇒ Object
Returns the value of attribute text.
-
#truncated ⇒ Object
Returns the value of attribute truncated.
Instance Method Summary collapse
-
#initialize(data = nil) ⇒ StatusBasic
constructor
A new instance of StatusBasic.
Constructor Details
#initialize(data = nil) ⇒ StatusBasic
Returns a new instance of StatusBasic.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/tuiter/data/status.rb', line 14 def initialize(data = nil) unless data.nil? @created_at = (data["created_at"] ? DateTime.parse(data["created_at"]) : DateTime.now) @id = data["id"] @text = data["text"] @source = data["source"] @truncated = data["truncated"] @in_reply_to_status_id = data["in_reply_to_status_id"] @in_reply_to_user_id = data["in_reply_to_user_id"] @favorited = data["favorited"] @in_reply_to_screen_name = data["in_reply_to_screen_name"] else @created_at = DateTime.now end end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/tuiter/data/status.rb', line 4 def created_at @created_at end |
#favorited ⇒ Object
Returns the value of attribute favorited.
11 12 13 |
# File 'lib/tuiter/data/status.rb', line 11 def favorited @favorited end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/tuiter/data/status.rb', line 5 def id @id end |
#in_reply_to_screen_name ⇒ Object
Returns the value of attribute in_reply_to_screen_name.
12 13 14 |
# File 'lib/tuiter/data/status.rb', line 12 def in_reply_to_screen_name @in_reply_to_screen_name end |
#in_reply_to_status_id ⇒ Object
Returns the value of attribute in_reply_to_status_id.
9 10 11 |
# File 'lib/tuiter/data/status.rb', line 9 def in_reply_to_status_id @in_reply_to_status_id end |
#in_reply_to_user_id ⇒ Object
Returns the value of attribute in_reply_to_user_id.
10 11 12 |
# File 'lib/tuiter/data/status.rb', line 10 def in_reply_to_user_id @in_reply_to_user_id end |
#source ⇒ Object
Returns the value of attribute source.
7 8 9 |
# File 'lib/tuiter/data/status.rb', line 7 def source @source end |
#text ⇒ Object
Returns the value of attribute text.
6 7 8 |
# File 'lib/tuiter/data/status.rb', line 6 def text @text end |
#truncated ⇒ Object
Returns the value of attribute truncated.
8 9 10 |
# File 'lib/tuiter/data/status.rb', line 8 def truncated @truncated end |