Class: Twitter::Media::Photo
- Defined in:
- lib/twitter/media/photo.rb
Instance Attribute Summary collapse
-
#display_url ⇒ Object
readonly
Returns the value of attribute display_url.
-
#expanded_url ⇒ Object
readonly
Returns the value of attribute expanded_url.
-
#indices ⇒ Object
readonly
Returns the value of attribute indices.
-
#media_url ⇒ Object
readonly
Returns the value of attribute media_url.
-
#media_url_https ⇒ Object
readonly
Returns the value of attribute media_url_https.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Attributes inherited from Base
Instance Method Summary collapse
-
#sizes ⇒ Array<Twitter::Size>
Returns an array of photo sizes.
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_url ⇒ Object (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_url ⇒ Object (readonly)
Returns the value of attribute expanded_url.
7 8 9 |
# File 'lib/twitter/media/photo.rb', line 7 def @expanded_url end |
#indices ⇒ Object (readonly)
Returns the value of attribute indices.
7 8 9 |
# File 'lib/twitter/media/photo.rb', line 7 def indices @indices end |
#media_url ⇒ Object (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_https ⇒ Object (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 |
#url ⇒ Object (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
#sizes ⇒ Array<Twitter::Size>
Returns an array of photo sizes
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 |