Class: DaFace::Datasift::Twitter
- Inherits:
-
Object
- Object
- DaFace::Datasift::Twitter
- Includes:
- Utilities
- Defined in:
- lib/da_face/datasift/twitter.rb
Instance Attribute Summary collapse
-
#retweet ⇒ Object
readonly
Returns the value of attribute retweet.
-
#retweeted ⇒ Object
readonly
Returns the value of attribute retweeted.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#tweet ⇒ Object
readonly
Returns the value of attribute tweet.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Twitter
constructor
A new instance of Twitter.
- #retweet? ⇒ Boolean
Methods included from Utilities
#parse_json, #parse_timestamp, #parse_uri, #symbolize_keys
Constructor Details
#initialize(data) ⇒ Twitter
Returns a new instance of Twitter.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/da_face/datasift/twitter.rb', line 16 def initialize data if data.keys.include? :retweet @tweet = DaFace::Twitter::Parser.parse extract_retweet_info(data), true @retweeted = DaFace::Twitter::Parser.parse extract_tweet_info(data), false @retweet = true else @tweet = DaFace::Twitter::Parser.parse extract_tweet_info(data), false @retweet = false end end |
Instance Attribute Details
#retweet ⇒ Object (readonly)
Returns the value of attribute retweet.
6 7 8 |
# File 'lib/da_face/datasift/twitter.rb', line 6 def retweet @retweet end |
#retweeted ⇒ Object (readonly)
Returns the value of attribute retweeted.
6 7 8 |
# File 'lib/da_face/datasift/twitter.rb', line 6 def retweeted @retweeted end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/da_face/datasift/twitter.rb', line 6 def status @status end |
#tweet ⇒ Object (readonly)
Returns the value of attribute tweet.
6 7 8 |
# File 'lib/da_face/datasift/twitter.rb', line 6 def tweet @tweet end |
Class Method Details
.new(data) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/da_face/datasift/twitter.rb', line 8 def self.new data if data[:status] return DaFace::Datasift::TwitterUserStatus.new(data) else super end end |
Instance Method Details
#retweet? ⇒ Boolean
27 28 29 |
# File 'lib/da_face/datasift/twitter.rb', line 27 def retweet? @retweet end |