Skip to content

Commit

Permalink
Remove notification methods; use Twitter::API#friendship_update ins…
Browse files Browse the repository at this point in the history
…tead
  • Loading branch information
sferik committed Sep 17, 2012
1 parent 03c4c14 commit 3b2d2b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 95 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ Here are some fun facts about the 3.0 release:

* The entire library is implemented in just 2,000 lines of code
* With over 5,000 lines of specs, the spec-to-code ratio is over 2.5:1
* The spec suite contains 665 examples and runs in under 2 seconds on a MacBook
* The spec suite contains 661 examples and runs in under 2 seconds on a MacBook
* This project has 100% C0 code coverage (the tests execute every line of
source code at least once)
* At the time of release, this library is comprehensive: you can request all
Expand Down
50 changes: 5 additions & 45 deletions lib/twitter/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ module API
:direct_messages => true,
:direct_messages_received => true,
:direct_messages_sent => true,
:disable_notifications => false,
:enable_notifications => false,
:end_session => false,
:fav => false,
:fave => false,
Expand Down Expand Up @@ -476,14 +474,14 @@ def direct_message(id, options={})
# @overload direct_messages(*ids)
# Returns direct messages
#
# @see https://dev.twitter.com/docs/api/1.1/get/direct_messages/show/%3Aid
# @see https://dev.twitter.com/docs/api/1.1/get/direct_messages/show/:id
# @param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs.
# @example Return the direct message with the id 1825786345
# Twitter.direct_messages(1825786345)
# @overload direct_messages(*ids, options)
# Returns direct messages
#
# @see https://dev.twitter.com/docs/api/1.1/get/direct_messages/show/%3Aid
# @see https://dev.twitter.com/docs/api/1.1/get/direct_messages/show/:id
# @param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs.
# @param options [Hash] A customizable set of options.
def direct_messages(*args)
Expand Down Expand Up @@ -1457,44 +1455,6 @@ def list(*args)
list_from_response(:get, "/1.1/lists/show.json", args)
end

# Enables device notifications for updates from the specified users to the authenticating user
#
# @see https://dev.twitter.com/docs/api/1.1/post/notifications/follow
# @rate_limited No
# @authentication_required Requires user context
# @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
# @return [Array<Twitter::User>] The specified users.
# @overload enable_notifications(*users)
# @param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects.
# @example Enable device notifications for updates from @sferik
# Twitter.enable_notifications('sferik')
# Twitter.enable_notifications(7505382) # Same as above
# @overload enable_notifications(*users, options)
# @param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects.
# @param options [Hash] A customizable set of options.
def enable_notifications(*args)
threaded_users_from_response(:post, "/1.1/notifications/follow.json", args)
end

# Disables notifications for updates from the specified users to the authenticating user
#
# @see https://dev.twitter.com/docs/api/1.1/post/notifications/leave
# @rate_limited No
# @authentication_required Requires user context
# @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
# @return [Array<Twitter::User>] The specified users.
# @overload disable_notifications(*users)
# @param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects.
# @example Disable device notifications for updates from @sferik
# Twitter.disable_notifications('sferik')
# Twitter.disable_notifications(7505382) # Same as above
# @overload disable_notifications(*users, options)
# @param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects.
# @param options [Hash] A customizable set of options.
def disable_notifications(*args)
threaded_users_from_response(:post, "/1.1/notifications/leave.json", args)
end

# The users specified are blocked by the authenticated user and reported as spammers
#
# @see https://dev.twitter.com/docs/api/1.1/post/report_spam
Expand Down Expand Up @@ -2177,7 +2137,7 @@ def update(status, options={})

# Updates the authenticating user's status with media
#
# @see http://dev.twitter.com/docs/api/1.1/post/statuses/update_with_media
# @see https://dev.twitter.com/docs/api/1.1/post/statuses/update_with_media
# @note A status update with text/media identical to the authenticating user's current status will NOT be ignored
# @rate_limited No
# @authentication_required Requires user context
Expand Down Expand Up @@ -2476,7 +2436,7 @@ def user?(user, options={})

# Returns an array of users that the specified user can contribute to
#
# @see http://dev.twitter.com/docs/api/1.1/get/users/contributees
# @see https://dev.twitter.com/docs/api/1.1/get/users/contributees
# @rate_limited Yes
# @authentication_required Requires user context
# @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
Expand All @@ -2499,7 +2459,7 @@ def contributees(*args)

# Returns an array of users who can contribute to the specified account
#
# @see http://dev.twitter.com/docs/api/1.1/get/users/contributors
# @see https://dev.twitter.com/docs/api/1.1/get/users/contributors
# @rate_limited Yes
# @authentication_required Requires user context
# @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
Expand Down
49 changes: 0 additions & 49 deletions spec/twitter/api/notifications_spec.rb

This file was deleted.

0 comments on commit 3b2d2b8

Please sign in to comment.