Sha256: a6f795c3dc31727eb05d2ccb116bea57b6218a56a7c4462df749bfee1c0a1789
Contents?: true
Size: 1.6 KB
Versions: 1
Compression:
Stored size: 1.6 KB
Contents
module Lapse class Client # Client methods for working with users module Users # Authenticates a user # # Requires authenticatied client. # # @return [Hashie::Mash] # @see Lapse::Client # @example # client.me def authenticate(twitter_access_token) result = post('authenticate', twitter_access_token: twitter_access_token) hash = { :user => result.body, :access_token => result.headers['x-access-token'] } case @result_format when :mashie Hashie::Mash.new(hash) else hash end end # Get the current user # # Requires authenticatied client. # # @return [Hashie::Mash] # @see Totter::Client # @example # client.me def me get('me').body end def update_me(options = {}) params = { user: options } patch('me', params).body end def user(user_id, params = {}) get("users/#{user_id}", params).body end def follow(user_id) boolean_from_response(:post, "users/#{user_id}/follow") end def unfollow(user_id) boolean_from_response(:post, "users/#{user_id}/unfollow") end def following(user_id, params = {}) get("users/#{user_id}/following", params).body end def followers(user_id, params = {}) get("users/#{user_id}/followers", params).body end def block(user_id) boolean_from_response(:post, "users/#{user_id}/block") end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lapse-0.0.18 | lib/lapse/client/users.rb |