Class: Twitter::Status
Instance Attribute Summary
Attributes inherited from Base
#attrs
Instance Method Summary
collapse
Methods included from Creatable
#created_at
Methods inherited from Base
#[], #initialize, lazy_attr_reader
Constructor Details
This class inherits a constructor from Twitter::Base
Instance Method Details
#==(other) ⇒ Boolean
26
27
28
|
# File 'lib/twitter/status.rb', line 26
def ==(other)
super || (other.class == self.class && other.id == self.id)
end
|
#expanded_urls ⇒ Array<String>
Note:
Must :include_entities in your request for this method to work
32
33
34
35
36
|
# File 'lib/twitter/status.rb', line 32
def expanded_urls
@expanded_urls ||= Array(@attrs['entities']['urls']).map do |url|
url['expanded_url']
end unless @attrs['entities'].nil?
end
|
39
40
41
|
# File 'lib/twitter/status.rb', line 39
def geo
@geo ||= Twitter::GeoFactory.new(@attrs['geo']) unless @attrs['geo'].nil?
end
|
Note:
Must :include_entities in your request for this method to work
45
46
47
48
49
|
# File 'lib/twitter/status.rb', line 45
def media
@media ||= Array(@attrs['entities']['media']).map do |media|
Twitter::MediaFactory.new(media)
end unless @attrs['entities'].nil?
end
|
52
53
54
|
# File 'lib/twitter/status.rb', line 52
def metadata
@metadata ||= Twitter::Metadata.new(@attrs['metadata']) unless @attrs['metadata'].nil?
end
|
74
75
76
77
|
# File 'lib/twitter/status.rb', line 74
def oembed(options={})
@client ||= Twitter::Client.new
@client.oembed(@attrs['id'], options) unless @attrs['id'].nil?
end
|
57
58
59
|
# File 'lib/twitter/status.rb', line 57
def place
@place ||= Twitter::Place.new(@attrs['place']) unless @attrs['place'].nil?
end
|
If this status is itself a retweet, the original tweet is available here.
69
70
71
|
# File 'lib/twitter/status.rb', line 69
def
@retweeted_status ||= self.class.new(@attrs['retweeted_status']) unless @attrs['retweeted_status'].nil?
end
|
62
63
64
|
# File 'lib/twitter/status.rb', line 62
def user
@user ||= Twitter::User.new(@attrs.dup['user'].merge('status' => @attrs.except('user'))) unless @attrs['user'].nil?
end
|