Module: Fleetly::User

Included in:
Client
Defined in:
lib/fleetly/user.rb

Instance Method Summary collapse

Instance Method Details

#me(options = {}) ⇒ Hashie::Mash

Retrieve information about ‘me` associated to the `oauth_token`

Parameters:

  • :include_activities (Integer)

    (1,0) ‘0` default

  • :include_challenges (Integer)

    (1,0) ‘0` default

  • :include_friends (Integer)

    (1,0) ‘0` default

Returns:

  • (Hashie::Mash)

    User



15
16
17
18
19
20
# File 'lib/fleetly/user.rb', line 15

def me(options={})
  options[:oauth_token] = token
  user_me_response = get('/api/v1/users/me', options)

  user_me_response if user_me_response.result?
end

#user_search(options = {}) ⇒ Hashie::Mash

Retrieve users base on search params associated to the ‘oauth_token`

Parameters:

  • :name (String)

    ‘partial name of user you want to search’

  • :include_activities (Integer)

    (1,0) ‘0` default

  • :include_challenges (Integer)

    (1,0) ‘0` default

  • :include_friends (Integer)

    (1,0) ‘0` default

Returns:

  • (Hashie::Mash)

    User



32
33
34
35
36
37
# File 'lib/fleetly/user.rb', line 32

def user_search(options={})
  options[:oauth_token] = token
  user_me_response = get('/api/v1/users/search', options)

  user_me_response if user_me_response.result?
end