Class: Tuiter::StatusBasic

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

Direct Known Subclasses

Status

Instance Attribute Summary collapse

Instance Method Summary collapse

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_atObject

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#favoritedObject

Returns the value of attribute favorited.



11
12
13
# File 'lib/tuiter/data/status.rb', line 11

def favorited
  @favorited
end

#idObject

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_nameObject

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_idObject

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_idObject

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

#sourceObject

Returns the value of attribute source.



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

def source
  @source
end

#textObject

Returns the value of attribute text.



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

def text
  @text
end

#truncatedObject

Returns the value of attribute truncated.



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

def truncated
  @truncated
end