Class: Twitter::Media::Photo

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

Instance Attribute Summary (collapse)

Attributes inherited from Identity

#id

Attributes inherited from Base

#attrs

Instance Method Summary (collapse)

Methods inherited from Identity

#initialize

Methods inherited from Base

#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, deprecate_attribute_method, display_uri_attr_reader, #initialize, object_attr_reader, predicate_attr_reader, uri_attr_reader

Methods included from Utils

flat_pmap, pmap

Constructor Details

This class inherits a constructor from Twitter::Identity

Instance Attribute Details

- (Object) indices (readonly)

Returns the value of attribute indices



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

def indices
  @indices
end

Instance Method Details

- (Array<Twitter::Size>) sizes

Returns an array of photo sizes



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

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