Class: PassaporteWeb::Resources::Profile

Inherits:
Base
  • Object
show all
Defined in:
lib/passaporte_web/resources/profile.rb

Overview

A wrapper to PassaporteWeb's profile API

API

Documentation:

Examples:

Getting the user's profile:

client = PassaporteWeb::Client::Identity.new(credentials)
client.profile.get

Getting the user's list of emails:

client = PassaporteWeb::Client::Identity.new(credentials)
client.profile.emails

See Also:

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PassaporteWeb::Resources::Base

Instance Method Details

#contactsPassaporteWeb::Entities::Profile::Contacts

Retrieves the user's contacts

API

Method: GET /api/v1/profile/contacts

Documentation:

Returns:


50
51
52
53
# File 'lib/passaporte_web/resources/profile.rb', line 50

def contacts
  respond_with_entity(api.get('/api/v1/profile/contacts'),
                      PassaporteWeb::Entities::Profile::Contacts)
end

#emailsPassaporteWeb::Entities::Profile::Emails

Retrieves the user's emails

API

Method: GET /api/v1/profile/emails

Documentation:

Returns:


63
64
65
66
# File 'lib/passaporte_web/resources/profile.rb', line 63

def emails
  respond_with_entity(api.get('/api/v1/profile/emails'),
                      PassaporteWeb::Entities::Profile::Emails)
end

#getPassaporteWeb::Entities::Profile

Retrieves the user's profile

API

Method: GET /api/v1/profile

Documentation:

Returns:


25
26
27
# File 'lib/passaporte_web/resources/profile.rb', line 25

def get
  respond_with_entity(api.get('/api/v1/profile'))
end

#professional_infoPassaporteWeb::Entities::Profile::ProfessionalInfo

Retrieves the user's professional info

API

Method: GET /api/v1/profile/professional_info

Documentation:

Returns:


37
38
39
40
# File 'lib/passaporte_web/resources/profile.rb', line 37

def professional_info
  respond_with_entity(api.get('/api/v1/profile/professional_info'),
                      PassaporteWeb::Entities::Profile::ProfessionalInfo)
end