lib/totter/client/users.rb in totter-0.2.14 vs lib/totter/client/users.rb in totter-0.3.0
- old
+ new
@@ -9,21 +9,21 @@
# @return [Hashie::Mash]
# @see Totter::Client
# @example
# client.me
def me
- get 'me'
+ get('me').body
end
# Get a single user
#
# @param user [String] A Seeaw username or ID.
# @return [Hashie::Mash]
# @example
# Totter.user('soffes')
def user(user)
- get "users/#{user}"
+ get("users/#{user}").body
end
# Updates the authenticating user
#
# @param options [Hash] Properties to be updated
@@ -41,11 +41,11 @@
# @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
+ put("me", data).body
end
# Follow a user.
#
# Requires authenticatied client.
@@ -54,11 +54,11 @@
# @return [Boolean] True if follow was successful, false otherwise.
# @see Totter::Client
# @example
# client.follow('gotwalt')
def follow(user)
- boolean_from_response :post, "users/#{user}/follow"
+ boolean_from_response(:post, "users/#{user}/follow")
end
# Unfollow a user.
#
# Requires authenticatied client.
@@ -67,34 +67,34 @@
# @return [Boolean] True if unfollow was successful, false otherwise.
# @see Totter::Client
# @example
# client.unfollow('kyle')
def unfollow(user)
- boolean_from_response :post, "users/#{user}/unfollow"
+ boolean_from_response(:post, "users/#{user}/unfollow")
end
# @return Array of [Hashie::Mash]
# @param user_id [String] ID of the user
# @example
# client.followers('5')
def followers(user_id)
- get "users/#{user_id}/followers"
+ get("users/#{user_id}/followers").body
end
# @return Array of [Hashie::Mash]
# @param user_id [String] ID of the user
# @example
# client.following('5')
def following(user_id)
- get "users/#{user_id}/following"
+ get("users/#{user_id}/following").body
end
# @return Array of [Hashie::Mash]
# @param user_id [String] ID of the user
# @example
# client.user_votes('5')
def votes(user_id)
- get "users/#{user_id}/votes"
+ get("users/#{user_id}/votes").body
end
end
end
end