Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Hacks for Ruby 1.8 compatibility

  • Loading branch information...
commit 88c5a0513d1b58a1d4ae1a1e3deeb012c9d19547 1 parent 22af0c1
@sferik authored
View
24 lib/twitter/api/account.rb
@@ -7,17 +7,19 @@ module API
module Account
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :rate_limit_status => false,
- :verify_credentials => true,
- :current_user => true,
- :end_session => false,
- :update_delivery_device => false,
- :update_profile => false,
- :update_profile_background_image => false,
- :update_profile_colors => false,
- :update_profile_image => false,
- :settings => true,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :rate_limit_status => false,
+ :verify_credentials => true,
+ :current_user => true,
+ :end_session => false,
+ :update_delivery_device => false,
+ :update_profile => false,
+ :update_profile_background_image => false,
+ :update_profile_colors => false,
+ :update_profile_image => false,
+ :settings => true,
+ }
)
end
View
8 lib/twitter/api/activity.rb
@@ -7,9 +7,11 @@ module Activity
include Twitter::API::Utils
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :activity_about_me => true,
- :activity_by_friends => true,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :activity_about_me => true,
+ :activity_by_friends => true,
+ }
)
end
View
14 lib/twitter/api/blocks.rb
@@ -7,12 +7,14 @@ module Blocks
include Twitter::API::Utils
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :blocking => true,
- :blocked_ids => true,
- :block? => true,
- :block => true,
- :unblock => false,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :blocking => true,
+ :blocked_ids => true,
+ :block? => true,
+ :block => true,
+ :unblock => false,
+ }
)
end
View
20 lib/twitter/api/direct_messages.rb
@@ -10,15 +10,17 @@ module DirectMessages
include Twitter::API::Utils
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :direct_messages_received => true,
- :direct_messages_sent => true,
- :direct_message_destroy => false,
- :direct_message_create => false,
- :d => false,
- :m => false,
- :direct_message => true,
- :direct_messages => true,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :direct_messages_received => true,
+ :direct_messages_sent => true,
+ :direct_message_destroy => false,
+ :direct_message_create => false,
+ :d => false,
+ :m => false,
+ :direct_message => true,
+ :direct_messages => true,
+ }
)
end
View
42 lib/twitter/api/friendships.rb
@@ -12,26 +12,28 @@ module Friendships
include Twitter::API::Utils
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :follower_ids => true,
- :friend_ids => true,
- :friendship? => true,
- :friendships_incoming => true,
- :friendships_outgoing => true,
- :friendship => true,
- :friendship_show => true,
- :relationship => true,
- :follow => false,
- :friendship_create => false,
- :follow! => false,
- :friendship_create! => false,
- :unfollow => false,
- :friendship_destroy => false,
- :friendships => true,
- :friendship_update => true,
- :no_retweet_ids => true,
- :accept => false,
- :deny => false,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :follower_ids => true,
+ :friend_ids => true,
+ :friendship? => true,
+ :friendships_incoming => true,
+ :friendships_outgoing => true,
+ :friendship => true,
+ :friendship_show => true,
+ :relationship => true,
+ :follow => false,
+ :friendship_create => false,
+ :follow! => false,
+ :friendship_create! => false,
+ :unfollow => false,
+ :friendship_destroy => false,
+ :friendships => true,
+ :friendship_update => true,
+ :no_retweet_ids => true,
+ :accept => false,
+ :deny => false,
+ }
)
end
View
16 lib/twitter/api/geo.rb
@@ -7,13 +7,15 @@ module Geo
include Twitter::API::Utils
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :places_nearby => true,
- :geo_search => true,
- :places_similar => true,
- :reverse_geocode => true,
- :place => true,
- :place_create => true,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :places_nearby => true,
+ :geo_search => true,
+ :places_similar => true,
+ :reverse_geocode => true,
+ :place => true,
+ :place_create => true,
+ }
)
end
View
8 lib/twitter/api/help.rb
@@ -8,9 +8,11 @@ module Help
include Twitter::API::Utils
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :configuration => true,
- :languages => true,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :configuration => true,
+ :languages => true,
+ }
)
end
View
8 lib/twitter/api/legal.rb
@@ -3,9 +3,11 @@ module API
module Legal
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :privacy => true,
- :tos => true,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :privacy => true,
+ :tos => true,
+ }
)
end
View
42 lib/twitter/api/lists.rb
@@ -12,26 +12,28 @@ module Lists
MAX_USERS_PER_REQUEST = 100
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :lists_subscribed_to => true,
- :list_timeline => true,
- :list_remove_member => false,
- :memberships => true,
- :list_subscribers => true,
- :subscriptions => true,
- :list_subscribe => false,
- :list_subscriber? => true,
- :list_unsubscribe => false,
- :list_add_members => false,
- :list_remove_members => false,
- :list_member? => true,
- :list_members => true,
- :list_add_member => false,
- :list_destroy => false,
- :list_update => false,
- :list_create => false,
- :lists => true,
- :list => true,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :lists_subscribed_to => true,
+ :list_timeline => true,
+ :list_remove_member => false,
+ :memberships => true,
+ :list_subscribers => true,
+ :subscriptions => true,
+ :list_subscribe => false,
+ :list_subscriber? => true,
+ :list_unsubscribe => false,
+ :list_add_members => false,
+ :list_remove_members => false,
+ :list_member? => true,
+ :list_members => true,
+ :list_add_member => false,
+ :list_destroy => false,
+ :list_update => false,
+ :list_create => false,
+ :lists => true,
+ :list => true,
+ }
)
end
View
8 lib/twitter/api/notifications.rb
@@ -6,9 +6,11 @@ module Notifications
include Twitter::API::Utils
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :enable_notifications => false,
- :disable_notifications => false,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :enable_notifications => false,
+ :disable_notifications => false,
+ }
)
end
View
6 lib/twitter/api/report_spam.rb
@@ -6,8 +6,10 @@ module ReportSpam
include Twitter::API::Utils
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :report_spam => true,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :report_spam => true,
+ }
)
end
View
12 lib/twitter/api/saved_searches.rb
@@ -9,11 +9,13 @@ module SavedSearches
include Twitter::API::Utils
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :saved_searches => true,
- :saved_search => true,
- :saved_search_create => false,
- :saved_search_destroy => false,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :saved_searches => true,
+ :saved_search => true,
+ :saved_search_create => false,
+ :saved_search_destroy => false,
+ }
)
end
View
8 lib/twitter/api/search.rb
@@ -7,9 +7,11 @@ module Search
include Twitter::API::Utils
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :search => true,
- :phoenix_search => true,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :search => true,
+ :phoenix_search => true,
+ }
)
end
View
58 lib/twitter/api/statuses.rb
@@ -10,34 +10,36 @@ module Statuses
include Twitter::API::Utils
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :favorites => true,
- :favorite => false,
- :fav => false,
- :fave => false,
- :favorite_create => false,
- :unfavorite => false,
- :favorite_destroy => false,
- :home_timeline => true,
- :mentions => true,
- :retweeted_by => true,
- :retweeted_to => true,
- :retweets_of_me => true,
- :user_timeline => true,
- :media_timeline => true,
- :network_timeline => true,
- :retweeters_of => true,
- :retweets => true,
- :status => true,
- :statuses => true,
- :status_activity => true,
- :statuses_activity => true,
- :oembed => true,
- :oembeds => true,
- :status_destroy => false,
- :retweet => true,
- :update => false,
- :update_with_media => false,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :favorites => true,
+ :favorite => false,
+ :fav => false,
+ :fave => false,
+ :favorite_create => false,
+ :unfavorite => false,
+ :favorite_destroy => false,
+ :home_timeline => true,
+ :mentions => true,
+ :retweeted_by => true,
+ :retweeted_to => true,
+ :retweets_of_me => true,
+ :user_timeline => true,
+ :media_timeline => true,
+ :network_timeline => true,
+ :retweeters_of => true,
+ :retweets => true,
+ :status => true,
+ :statuses => true,
+ :status_activity => true,
+ :statuses_activity => true,
+ :oembed => true,
+ :oembeds => true,
+ :status_destroy => false,
+ :retweet => true,
+ :update => false,
+ :update_with_media => false,
+ }
)
end
View
14 lib/twitter/api/trends.rb
@@ -8,12 +8,14 @@ module Trends
include Twitter::API::Utils
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :local_trends => true,
- :trends => true,
- :trend_locations => true,
- :trends_daily => true,
- :trends_weekly => true,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :local_trends => true,
+ :trends => true,
+ :trend_locations => true,
+ :trends_daily => true,
+ :trends_weekly => true,
+ }
)
end
View
24 lib/twitter/api/users.rb
@@ -13,17 +13,19 @@ module Users
MAX_USERS_PER_REQUEST = 100
def self.included(klass)
- klass.class_variable_get(:@@rate_limited).merge!(
- :suggestions => true,
- :suggest_users => true,
- :users => true,
- :user_search => true,
- :user => true,
- :user? => true,
- :contributees => true,
- :contributors => true,
- :recommendations => true,
- :following_followers_of => true,
+ klass.send(:class_variable_get, :@@rate_limited).merge!(
+ {
+ :suggestions => true,
+ :suggest_users => true,
+ :users => true,
+ :user_search => true,
+ :user => true,
+ :user? => true,
+ :contributees => true,
+ :contributors => true,
+ :recommendations => true,
+ :following_followers_of => true,
+ }
)
end

0 comments on commit 88c5a05

Please sign in to comment.
Something went wrong with that request. Please try again.