lib/totter/client/users.rb in totter-0.2.1 vs lib/totter/client/users.rb in totter-0.2.2

- old
+ new

@@ -22,9 +22,32 @@ # Seesaw.user('soffes') def user(user) get "users/#{user}" end + # Updates a given user + # + # @param user_id [Numeric] A Seesaw user ID. + # @param options [Hash] Properties to be updated + # @option options [String] :given_name The given name of the user + # @option options [String] :family_name The Family name of the user + # @option options [String] :email The email address of the user + # @option options [String] :username The username of the user + # @param preferences [Hash] Preferences to be set + # @option preferences [Boolean] :notification_friends Notify when friends post a decision + # @option preferences [Boolean] :notification_invitee_votes Notify when invitee votes + # @option preferences [Boolean] :notification_comments Notify when someone comments on user's decision + # @option preferences [Boolean] :notification_following_votes Notify when user is following other_user who votes + # @option preferences [Boolean] :notification_other_votes Notify using throttled notifier when non-invited users vote on your post + # @option preferences [Boolean] :notification_after_votes Notify when other_user votes after user has already voted on a decision + # @option preferences [Boolean] :notification_following Notify when other_user starts follwing user + def update_me(options = {}, preferences = {}) + data = { + user: options.merge({preferences: preferences}) + } + put "me", data + end + # Follow a user. # # Requires authenticatied client. # # @param user [String] Username or ID of the user to follow.