Class: Twitter::Tweet

### Home Classes Methods

### In Files

- lib/twitter/tweet.rb

### Parent

Twitter::Identity

### Methods

- #entities?
- #favoriters_count
- #filter_level
- #from_user
- #full_text
- #geo
- #hashtags
- #media
- #metadata
- #place
- #repliers_count
- #reply?
- #reply_count
- #retweet
- #retweet?
- #retweet_count
- #retweeted_status
- #retweeted_tweet
- #retweeters_count
- #urls
- #user
- #user?
- #user_mentions

### Included Modules

- Twitter::Creatable
- Twitter::Exceptable

### Class/Module Index

Quicksearch

- Twitter
- Twitter::API
- Twitter::API::Arguments
- Twitter::API::DirectMessages
- Twitter::API::Favorites
- Twitter::API::FriendsAndFollowers
- Twitter::API::Help
- Twitter::API::Lists
- Twitter::API::PlacesAndGeo
- Twitter::API::SavedSearches
- Twitter::API::Search
- Twitter::API::SpamReporting
- Twitter::API::SuggestedUsers
- Twitter::API::Timelines
- Twitter::API::Trends
- Twitter::API::Tweets
- Twitter::API::Undocumented
- Twitter::API::Users
- Twitter::API::Utils
- Twitter::Action
- Twitter::Action::Favorite
- Twitter::Action::Follow
- Twitter::Action::ListMemberAdded
- Twitter::Action::Mention
- Twitter::Action::Reply
- Twitter::Action::Retweet
- Twitter::Action::Status
- Twitter::Action::Tweet
- Twitter::ActionFactory
- Twitter::Base
- Twitter::BasicUser
- Twitter::Client
- Twitter::Configurable
- Twitter::Configuration
- Twitter::Creatable
- Twitter::Cursor
- Twitter::Default
- Twitter::DirectMessage
- Twitter::Entity
- Twitter::Entity::Hashtag
- Twitter::Entity::Url
- Twitter::Entity::UserMention
- Twitter::Error
- Twitter::Error::AlreadyFavorited
- Twitter::Error::AlreadyRetweeted
- Twitter::Error::BadGateway
- Twitter::Error::BadRequest
- Twitter::Error::ClientError
- Twitter::Error::ConfigurationError
- Twitter::Error::DecodeError
- Twitter::Error::EnhanceYourCalm
- Twitter::Error::Forbidden
- Twitter::Error::GatewayTimeout
- Twitter::Error::IdentityMapKeyError
- Twitter::Error::InternalServerError
- Twitter::Error::NotAcceptable
- Twitter::Error::NotFound
- Twitter::Error::RateLimited
- Twitter::Error::ServerError
- Twitter::Error::ServiceUnavailable
- Twitter::Error::TooManyRequests
- Twitter::Error::Unauthorized
- Twitter::Error::UnprocessableEntity
- Twitter::Exceptable
- Twitter::Factory
- Twitter::Geo
- Twitter::Geo::Point
- Twitter::Geo::Polygon
- Twitter::GeoFactory
- Twitter::Identity
- Twitter::IdentityMap
- Twitter::Language
- Twitter::List
- Twitter::Media
- Twitter::Media::Photo
- Twitter::MediaFactory
- Twitter::Metadata
- Twitter::OEmbed
- Twitter::Place
- Twitter::ProfileBanner
- Twitter::RateLimit
- Twitter::Relationship
- Twitter::Request
- Twitter::Request::MultipartWithFile
- Twitter::Response
- Twitter::Response::ParseJson
- Twitter::Response::RaiseError
- Twitter::SavedSearch
- Twitter::SearchResults
- Twitter::Settings
- Twitter::Size
- Twitter::SourceUser
- Twitter::Status
- Twitter::Suggestion
- Twitter::TargetUser
- Twitter::Trend
- Twitter::Tweet
- Twitter::User
- Twitter::Version
- Enumerable
- Kernel

No matching classes.

# Twitter::Tweet

### Attributes

favorite_count[R]
favorited[R]
favoriters[R]
favorites_count[R]
favourite_count[R]
favourited[R]
favouriters[R]
favouriters_count[R]
favourites_count[R]
from_user_id[R]
from_user_name[R]
in_reply_to_attrs_id[R]
in_reply_to_screen_name[R]
in_reply_to_status_id[R]
in_reply_to_tweet_id[R]
in_reply_to_user_id[R]
lang[R]
repliers[R]
retweeted[R]
retweeters[R]
source[R]
text[R]
to_user[R]
to_user_id[R]
to_user_name[R]
truncated[R]

### Public Instance Methods

entities?() click to toggle source

@return [Boolean]

    # File lib/twitter/tweet.rb, line 27
    def entities?
      !@attrs[:entities].nil?
    end

favoriters_count() click to toggle source

@return [Integer]

    # File lib/twitter/tweet.rb, line 32
    def favoriters_count
      favoriters_count = @attrs[:favoriters_count]
      favoriters_count.to_i if favoriters_count
    end

filter_level() click to toggle source

    # File lib/twitter/tweet.rb, line 42
    def filter_level
      @attrs[:filter_level] || "none"
    end

from_user() click to toggle source

@return [String]

    # File lib/twitter/tweet.rb, line 38
    def from_user
      @attrs[:from_user] || user && user.screen_name
    end

full_text() click to toggle source

@return [String] @note May be > 140 characters.

    # File lib/twitter/tweet.rb, line 48
    def full_text
      if retweeted_status
        prefix = text[/\A(RT @[a-z0-9_]{1,20}: )/, 1]
        [prefix, retweeted_status.text].compact.join
      else
        text
      end
    end

geo() click to toggle source

@return [Twitter::Geo]

    # File lib/twitter/tweet.rb, line 58
    def geo
      @geo ||= Twitter::GeoFactory.fetch_or_new(@attrs[:geo])
    end

hashtags() click to toggle source

@note Must include entities in your request for this method to work @return [Array<Twitter::Entity::Hashtag>]

    # File lib/twitter/tweet.rb, line 64
    def hashtags
      @hashtags ||= entities(Twitter::Entity::Hashtag, :hashtags)
    end

media() click to toggle source

@note Must include entities in your request for this method to work @return [Array<Twitter::Media>]

    # File lib/twitter/tweet.rb, line 70
    def media
      @media ||= entities(Twitter::MediaFactory, :media)
    end

metadata() click to toggle source

@return [Twitter::Metadata]

    # File lib/twitter/tweet.rb, line 75
    def metadata
      @metadata ||= Twitter::Metadata.fetch_or_new(@attrs[:metadata])
    end

place() click to toggle source

@return [Twitter::Place]

    # File lib/twitter/tweet.rb, line 80
    def place
      @place ||= Twitter::Place.fetch_or_new(@attrs[:place])
    end

repliers_count() click to toggle source

@return [Integer]

    # File lib/twitter/tweet.rb, line 85
    def repliers_count
      repliers_count = @attrs[:repliers_count]
      repliers_count.to_i if repliers_count
    end

Also aliased as: reply_count
reply?() click to toggle source

@return [Boolean]

    # File lib/twitter/tweet.rb, line 92
    def reply?
      !!in_reply_to_status_id
    end

reply_count() click to toggle source
Alias for: repliers_count
retweet() click to toggle source
Alias for: retweeted_status
retweet?() click to toggle source

@return [Boolean]

    # File lib/twitter/tweet.rb, line 97
    def retweet?
      !!retweeted_status
    end

retweet_count() click to toggle source
Alias for: retweeters_count
retweeted_status() click to toggle source

If this Tweet is a retweet, the original Tweet is available here.

@return [Twitter::Tweet]

    # File lib/twitter/tweet.rb, line 104
    def retweeted_status
      @retweeted_status ||= self.class.fetch_or_new(@attrs[:retweeted_status])
    end

Also aliased as: retweeted_tweet, retweet
retweeted_tweet() click to toggle source
Alias for: retweeted_status
retweeters_count() click to toggle source

@return [String]

    # File lib/twitter/tweet.rb, line 111
    def retweeters_count
      retweeters_count = (@attrs[:retweet_count] || @attrs[:retweeters_count])
      retweeters_count.to_i if retweeters_count
    end

Also aliased as: retweet_count
urls() click to toggle source

@note Must include entities in your request for this method to work @return [Array<Twitter::Entity::Url>]

    # File lib/twitter/tweet.rb, line 119
    def urls
      @urls ||= entities(Twitter::Entity::Url, :urls)
    end

user() click to toggle source

@return [Twitter::User]

    # File lib/twitter/tweet.rb, line 124
    def user
      @user ||= fetch_or_new_without_self(Twitter::User, @attrs, :user, :status)
    end

user?() click to toggle source

    # File lib/twitter/tweet.rb, line 134
    def user?
      !@attrs[:user].nil?
    end

user_mentions() click to toggle source

@note Must include entities in your request for this method to work @return [Array<Twitter::Entity::UserMention>]

    # File lib/twitter/tweet.rb, line 130
    def user_mentions
      @user_mentions ||= entities(Twitter::Entity::UserMention, :user_mentions)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.