Class: Birdsong::Tweet
- Inherits:
-
Object
- Object
- Birdsong::Tweet
- Defined in:
- lib/birdsong/tweet.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
(also: #user)
readonly
Returns the value of attribute author.
-
#author_id ⇒ Object
readonly
Returns the value of attribute author_id.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#image_file_names ⇒ Object
readonly
Returns the value of attribute image_file_names.
-
#json ⇒ Object
readonly
Attributes for after the response is parsed from Twitter.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#video_file_names ⇒ Object
readonly
Returns the value of attribute video_file_names.
-
#video_file_type ⇒ Object
readonly
Returns the value of attribute video_file_type.
-
#video_preview_image ⇒ Object
readonly
Returns the value of attribute video_preview_image.
Class Method Summary collapse
Instance Attribute Details
#author ⇒ Object (readonly) Also known as: user
Returns the value of attribute author.
26 27 28 |
# File 'lib/birdsong/tweet.rb', line 26 def @author end |
#author_id ⇒ Object (readonly)
Returns the value of attribute author_id.
25 26 27 |
# File 'lib/birdsong/tweet.rb', line 25 def @author_id end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
22 23 24 |
# File 'lib/birdsong/tweet.rb', line 22 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
21 22 23 |
# File 'lib/birdsong/tweet.rb', line 21 def id @id end |
#image_file_names ⇒ Object (readonly)
Returns the value of attribute image_file_names.
27 28 29 |
# File 'lib/birdsong/tweet.rb', line 27 def image_file_names @image_file_names end |
#json ⇒ Object (readonly)
Attributes for after the response is parsed from Twitter
20 21 22 |
# File 'lib/birdsong/tweet.rb', line 20 def json @json end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
24 25 26 |
# File 'lib/birdsong/tweet.rb', line 24 def language @language end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
23 24 25 |
# File 'lib/birdsong/tweet.rb', line 23 def text @text end |
#video_file_names ⇒ Object (readonly)
Returns the value of attribute video_file_names.
28 29 30 |
# File 'lib/birdsong/tweet.rb', line 28 def video_file_names @video_file_names end |
#video_file_type ⇒ Object (readonly)
Returns the value of attribute video_file_type.
29 30 31 |
# File 'lib/birdsong/tweet.rb', line 29 def video_file_type @video_file_type end |
#video_preview_image ⇒ Object (readonly)
Returns the value of attribute video_preview_image.
30 31 32 |
# File 'lib/birdsong/tweet.rb', line 30 def video_preview_image @video_preview_image end |
Class Method Details
.lookup(ids = []) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/birdsong/tweet.rb', line 5 def self.lookup(ids = []) # If a single id is passed in we make it the appropriate array ids = [ids] unless ids.kind_of?(Array) # Check that the ids are at least real ids ids.each { |id| raise Birdsong::InvalidIdError if !/\A\d+\z/.match(id) } tweet_objects = ids.map { |id| Birdsong::TweetScraper.new.parse(id) } tweet_objects.map do |tweet_object| Tweet.new(tweet_object) end end |