Sha256: 3d55dc5c5c2b480984f0da79b4623a964d6315e2026e71eb4057715fba8fb8c3

Contents?: true

Size: 515 Bytes

Versions: 7

Compression:

Stored size: 515 Bytes

Contents

require 'twitter/identity'
require 'twitter/size'

module Twitter
  module Media
    class Photo < Twitter::Identity
      attr_reader :display_url, :expanded_url, :indices, :media_url,
        :media_url_https, :url

      # Returns an array of photo sizes
      #
      # @return [Array<Twitter::Size>]
      def sizes
        @sizes ||= Array(@attrs[:sizes]).inject({}) do |object, (key, value)|
          object[key] = Twitter::Size.fetch_or_new(value)
          object
        end
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
twitter-4.4.0 lib/twitter/media/photo.rb
twitter-4.3.0 lib/twitter/media/photo.rb
twitter-4.2.0 lib/twitter/media/photo.rb
twitter-4.1.2 lib/twitter/media/photo.rb
twitter-4.1.1 lib/twitter/media/photo.rb
twitter-4.1.0 lib/twitter/media/photo.rb
twitter-4.0.0 lib/twitter/media/photo.rb