Class: Twitter::Media::Photo

Inherits:
Identity
  • Object
show all
Defined in:
lib/hackeroo/media/photo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#display_urlObject (readonly)

Returns the value of attribute display_url.



6
7
8
# File 'lib/hackeroo/media/photo.rb', line 6

def display_url
  @display_url
end

#expanded_urlObject (readonly)

Returns the value of attribute expanded_url.



6
7
8
# File 'lib/hackeroo/media/photo.rb', line 6

def expanded_url
  @expanded_url
end

#indicesObject (readonly)

Returns the value of attribute indices.



6
7
8
# File 'lib/hackeroo/media/photo.rb', line 6

def indices
  @indices
end

#media_urlObject (readonly)

Returns the value of attribute media_url.



6
7
8
# File 'lib/hackeroo/media/photo.rb', line 6

def media_url
  @media_url
end

#media_url_httpsObject (readonly)

Returns the value of attribute media_url_https.



6
7
8
# File 'lib/hackeroo/media/photo.rb', line 6

def media_url_https
  @media_url_https
end

#urlObject (readonly)

Returns the value of attribute url.



6
7
8
# File 'lib/hackeroo/media/photo.rb', line 6

def url
  @url
end

Instance Method Details

#sizesArray<Twitter::Size>

Returns an array of photo sizes

Returns:

  • (Array<Twitter::Size>)


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

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