Module: Peerindex::Client::User
- Included in:
- Peerindex::Client
- Defined in:
- lib/peerindex/client/user.rb
Overview
Defines methods related to users
Instance Method Summary collapse
-
#merge_user_into_options!(user_id_or_screen_name, options = {}) ⇒ Hash
Take a single user ID or screen name and merge it into an options hash with the correct key.
-
#user(user, options = {}) ⇒ Hashie::Mash
Returns extended information of a given user.
-
#user?(user, options = {}) ⇒ Boolean
Returns true if the specified user exists.
Instance Method Details
#merge_user_into_options!(user_id_or_screen_name, options = {}) ⇒ Hash
Take a single user ID or screen name and merge it into an options hash with the correct key
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/peerindex/client/user.rb', line 48 def (user_id_or_screen_name, ={}) case user_id_or_screen_name when Fixnum [:id] = user_id_or_screen_name when String [:id] = user_id_or_screen_name end [:api_key] = self.api_key end |
#user(user, options = {}) ⇒ Hashie::Mash
Returns extended information of a given user
20 21 22 23 24 |
# File 'lib/peerindex/client/user.rb', line 20 def user(user, ={}) (user, ) response = get('version/profile/show', ) format.to_s.downcase == 'xml' ? response['user'] : response end |