Class: Twitter::Media::Photo

Inherits:
Identity show all
Defined in:
lib/twitter/media/photo.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Identity

#==, fetch, #id, #initialize, store

Methods inherited from Base

#[], attr_reader, fetch, fetch_or_new, from_response, identity_map, #initialize, store, #update

Constructor Details

This class inherits a constructor from Twitter::Identity

Instance Attribute Details

#display_urlObject (readonly)

Returns the value of attribute display_url.



7
8
9
# File 'lib/twitter/media/photo.rb', line 7

def display_url
  @display_url
end

#expanded_urlObject (readonly)

Returns the value of attribute expanded_url.



7
8
9
# File 'lib/twitter/media/photo.rb', line 7

def expanded_url
  @expanded_url
end

#indicesObject (readonly)

Returns the value of attribute indices.



7
8
9
# File 'lib/twitter/media/photo.rb', line 7

def indices
  @indices
end

#media_urlObject (readonly)

Returns the value of attribute media_url.



7
8
9
# File 'lib/twitter/media/photo.rb', line 7

def media_url
  @media_url
end

#media_url_httpsObject (readonly)

Returns the value of attribute media_url_https.



7
8
9
# File 'lib/twitter/media/photo.rb', line 7

def media_url_https
  @media_url_https
end

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/twitter/media/photo.rb', line 7

def url
  @url
end

Instance Method Details

#sizesArray<Twitter::Size>

Returns an array of photo sizes

Returns:



13
14
15
16
17
18
# File 'lib/twitter/media/photo.rb', line 13

def sizes
  @sizes ||= Array(@attrs[:sizes]).inject({}) do |object, (key, value)|
    object[key] = Twitter::Size.fetch_or_new(value)
    object
  end
end