Class: Twitter::Tweet
- Inherits:
-
Object
- Object
- Twitter::Tweet
- Includes:
- StronglyTyped::Model
- Defined in:
- lib/twitter/tweet.rb
Overview
Note:
Inspired from twitter-4.5.0/lib/twitter/api/timelines.rb
Class Method Summary collapse
-
.build_tweets(ary) ⇒ Array<Tweet>
Transform a json array into a collection of tweets.
Instance Method Summary collapse
Class Method Details
.build_tweets(ary) ⇒ Array<Tweet>
Transform a json array into a collection of tweets
20 21 22 23 24 25 26 27 28 |
# File 'lib/twitter/tweet.rb', line 20 def build_tweets(ary) tweets = ary.map do |tweet| args = { id: tweet['id'], text: tweet['text'], created_at: tweet['created_at'], screen_name: tweet['user']['screen_name'] } new(args) end end |
Instance Method Details
#status_url ⇒ Object
39 40 41 |
# File 'lib/twitter/tweet.rb', line 39 def status_url "https://twitter.com/#{screen_name}/status/#{id}" end |