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

- (Object) favorite_count (readonly)

Returns the value of attribute favorite_count



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

def favorite_count
  @favorite_count
end

- (Object) filter_level (readonly)

Returns the value of attribute filter_level



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

def filter_level
  @filter_level
end

- (Object) in_reply_to_attrs_id (readonly)

Returns the value of attribute in_reply_to_attrs_id



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

def in_reply_to_attrs_id
  @in_reply_to_attrs_id
end

- (Object) in_reply_to_screen_name (readonly)

Returns the value of attribute in_reply_to_screen_name



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

def in_reply_to_screen_name
  @in_reply_to_screen_name
end

- (Object) in_reply_to_status_id (readonly) Also known as: in_reply_to_tweet_id

Returns the value of attribute in_reply_to_status_id



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

def in_reply_to_status_id
  @in_reply_to_status_id
end

- (Object) in_reply_to_user_id (readonly)

Returns the value of attribute in_reply_to_user_id



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

def in_reply_to_user_id
  @in_reply_to_user_id
end

- (Object) lang (readonly)

Returns the value of attribute lang



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

def lang
  @lang
end

- (Object) retweet_count (readonly)

Returns the value of attribute retweet_count



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

def retweet_count
  @retweet_count
end

- (Object) source (readonly)

Returns the value of attribute source



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

def source
  @source
end

- (Object) text (readonly)

Returns the value of attribute text



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

def text
  @text
end

Instance Method Details

- (String) full_text

Note:

May be > 140 characters.



29
30
31
32
33
34
35
36
# File 'lib/twitter/tweet.rb', line 29

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

- (String) uri Also known as: url



40
41
42
# File 'lib/twitter/tweet.rb', line 40

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