diff --git a/lib/twitter/configuration.rb b/lib/twitter/configuration.rb index 64972fa41..d82bb6936 100644 --- a/lib/twitter/configuration.rb +++ b/lib/twitter/configuration.rb @@ -1,4 +1,3 @@ -require 'active_support/core_ext/enumerable' require 'twitter/base' require 'twitter/size' @@ -11,8 +10,9 @@ class Configuration < Twitter::Base # # @return [Array] def photo_sizes - @photo_sizes ||= Array(@attrs['photo_sizes']).each_with_object({}) do |(key, value), object| + @photo_sizes ||= Array(@attrs['photo_sizes']).inject({}) do |object, (key, value)| object[key] = Twitter::Size.new(value) + object end end diff --git a/lib/twitter/photo.rb b/lib/twitter/photo.rb index 6198cae21..6ba1a01fd 100644 --- a/lib/twitter/photo.rb +++ b/lib/twitter/photo.rb @@ -1,4 +1,3 @@ -require 'active_support/core_ext/enumerable' require 'twitter/base' require 'twitter/size' @@ -15,8 +14,9 @@ def ==(other) # @return [Array] def sizes - @sizes ||= Array(@attrs['sizes']).each_with_object({}) do |(key, value), object| + @sizes ||= Array(@attrs['sizes']).inject({}) do |object, (key, value)| object[key] = Twitter::Size.new(value) + object end end