Skip to content

Commit

Permalink
Add Twitter::Media::AnimatedGif media entity.
Browse files Browse the repository at this point in the history
  • Loading branch information
nidev committed Feb 6, 2015
1 parent 8f53f55 commit 76cb664
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions lib/twitter/media/animatedgif.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'twitter/identity'
require 'twitter/media/photo'

module Twitter
module Media
class AnimatedGif < Photo
end
end
end
3 changes: 1 addition & 2 deletions lib/twitter/media/photo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ class Photo < Twitter::Identity
#
# @return [Array<Twitter::Size>]
def sizes
@attrs.fetch(:sizes, []).inject({}) do |object, (key, value)|
@attrs.fetch(:sizes, []).each_with_object({}) do |(key, value), object|
object[key] = Size.new(value)
object
end
end
memoize :sizes
Expand Down
2 changes: 2 additions & 0 deletions lib/twitter/media_factory.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require 'twitter/factory'
require 'twitter/media/photo'
require 'twitter/media/animatedgif'
require 'twitter/media/video'

module Twitter
class MediaFactory < Twitter::Factory
Expand Down

0 comments on commit 76cb664

Please sign in to comment.