Class: Twitter::Tweet

Inherits:
Identity show all
Includes:
Creatable, Entities
Defined in:
lib/twitter/tweet.rb

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 Identity

#initialize

Methods inherited from Base

#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, deprecate_attribute_method, display_uri_attr_reader, #initialize, object_attr_reader, predicate_attr_reader, uri_attr_reader

Methods included from Utils

flat_pmap, pmap

Constructor Details

This class inherits a constructor from Twitter::Identity

Instance Attribute Details

#favorite_countInteger (readonly)



12
13
14
# File 'lib/twitter/tweet.rb', line 12

def favorite_count
  @favorite_count
end

#filter_levelString (readonly)



10
11
12
# File 'lib/twitter/tweet.rb', line 10

def filter_level
  @filter_level
end

#in_reply_to_screen_nameString (readonly)



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_idInteger (readonly) Also known as: in_reply_to_tweet_id



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_idInteger (readonly)



12
13
14
# File 'lib/twitter/tweet.rb', line 12

def in_reply_to_user_id
  @in_reply_to_user_id
end

#langString (readonly)



10
11
12
# File 'lib/twitter/tweet.rb', line 10

def lang
  @lang
end

#retweet_countInteger (readonly)



12
13
14
# File 'lib/twitter/tweet.rb', line 12

def retweet_count
  @retweet_count
end

#sourceString (readonly)



10
11
12
# File 'lib/twitter/tweet.rb', line 10

def source
  @source
end

#textString (readonly)



10
11
12
# File 'lib/twitter/tweet.rb', line 10

def text
  @text
end

Instance Method Details

#full_textString

Note:

May be > 140 characters.



32
33
34
35
36
37
38
39
# File 'lib/twitter/tweet.rb', line 32

def full_text
  if retweet?
    prefix = text[/\A(RT @[a-z0-9_]{1,20}: )/i, 1]
    [prefix, retweeted_status.text].compact.join
  else
    text
  end
end

#uriAddressable::URI Also known as: url



43
44
45
# File 'lib/twitter/tweet.rb', line 43

def uri
  Addressable::URI.parse("https://twitter.com/#{user.screen_name}/status/#{id}") if user?
end