Class: Twitter::Media::Photo
- Includes:
- Memoizable
- Defined in:
- lib/twitter/media/photo.rb
Instance Attribute Summary collapse
- #indices ⇒ Array<Integer> readonly
- #type ⇒ String readonly
Attributes inherited from Identity
Attributes inherited from Base
Instance Method Summary collapse
-
#sizes ⇒ Array<Twitter::Size>
Returns an array of photo sizes.
Methods inherited from Identity
Methods inherited from Base
#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, display_uri_attr_reader, #initialize, object_attr_reader, predicate_attr_reader, uri_attr_reader
Methods included from Utils
Constructor Details
This class inherits a constructor from Twitter::Identity
Instance Attribute Details
#indices ⇒ Array<Integer> (readonly)
10 11 12 |
# File 'lib/twitter/media/photo.rb', line 10 def indices @indices end |
#type ⇒ String (readonly)
13 14 15 |
# File 'lib/twitter/media/photo.rb', line 13 def type @type end |
Instance Method Details
#sizes ⇒ Array<Twitter::Size>
Returns an array of photo sizes
21 22 23 24 25 |
# File 'lib/twitter/media/photo.rb', line 21 def sizes @attrs.fetch(:sizes, []).each_with_object({}) do |(key, value), object| object[key] = Size.new(value) end end |