Class: Twitter::Tweet
Instance Attribute Summary collapse
Attributes inherited from Identity
#id
Attributes inherited from Base
#attrs
Instance Method Summary
collapse
Methods included from Entities
#entities?, #hashtags, #hashtags?, #media, #media?, #symbols, #symbols?, #uris, #uris?, #user_mentions, #user_mentions?
Methods included from Creatable
#created?, #created_at
Methods inherited from Base
#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, display_uri_attr_reader, object_attr_reader, predicate_attr_reader, uri_attr_reader
Methods included from Utils
flat_pmap, pmap
Constructor Details
36
37
38
39
|
# File 'lib/twitter/tweet.rb', line 36
def initialize(attrs = {})
attrs[:text] = attrs[:full_text] if attrs[:text].nil? && !attrs[:full_text].nil?
super
end
|
Instance Attribute Details
#favorite_count ⇒ Integer
12
13
14
|
# File 'lib/twitter/tweet.rb', line 12
def favorite_count
@favorite_count
end
|
#filter_level ⇒ String
10
11
12
|
# File 'lib/twitter/tweet.rb', line 10
def filter_level
@filter_level
end
|
#in_reply_to_screen_name ⇒ String
10
11
12
|
# File 'lib/twitter/tweet.rb', line 10
def in_reply_to_screen_name
@in_reply_to_screen_name
end
|
#in_reply_to_status_id ⇒ Integer
Also known as:
12
13
14
|
# File 'lib/twitter/tweet.rb', line 12
def in_reply_to_status_id
@in_reply_to_status_id
end
|
#in_reply_to_user_id ⇒ Integer
12
13
14
|
# File 'lib/twitter/tweet.rb', line 12
def in_reply_to_user_id
@in_reply_to_user_id
end
|
#lang ⇒ String
10
11
12
|
# File 'lib/twitter/tweet.rb', line 10
def lang
@lang
end
|
#quote_count ⇒ Integer
12
13
14
|
# File 'lib/twitter/tweet.rb', line 12
def quote_count
@quote_count
end
|
#reply_count ⇒ Integer
12
13
14
|
# File 'lib/twitter/tweet.rb', line 12
def reply_count
@reply_count
end
|
12
13
14
|
# File 'lib/twitter/tweet.rb', line 12
def
@retweet_count
end
|
#source ⇒ String
10
11
12
|
# File 'lib/twitter/tweet.rb', line 10
def source
@source
end
|
#text ⇒ String
10
11
12
|
# File 'lib/twitter/tweet.rb', line 10
def text
@text
end
|
Instance Method Details
#full_text ⇒ String
43
44
45
46
47
48
49
50
|
# File 'lib/twitter/tweet.rb', line 43
def full_text
if
prefix = text[/\A(RT @[a-z0-9_]{1,20}: )/i, 1]
[prefix, .text].compact.join
else
text
end
end
|
#uri ⇒ Addressable::URI
Also known as:
url
Returns The URL to the tweet.
54
55
56
|
# File 'lib/twitter/tweet.rb', line 54
def uri
Addressable::URI.parse("https://twitter.com/#{user.screen_name}/status/#{id}") if user?
end
|