Class: PassaporteWeb::Client::Identity

Inherits:
Object
  • Object
show all
Defined in:
lib/passaporte_web/client/identity.rb

Overview

PassaporteWeb Client for resources owned by an Identity

API

Documentation:

Examples:

Obtaining a user's profile:

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

Instance Method Summary collapse

Constructor Details

#initialize(credentials) ⇒ Identity

Creates an instance of this client.

Parameters:

  • The (#access_token, #access_token=, #refresh_token, #refresh_token=, #expires_at, #expires_at= #expires_in, #expires_in=)

    user credentials, obtained through the OAuth2 authorization flow.


18
19
20
21
# File 'lib/passaporte_web/client/identity.rb', line 18

def initialize(credentials)
  @credentials = credentials
  @token = PassaporteWeb::Client::ExceptionWrapper.new(OAuth2::AccessToken.from_hash(client, hash))
end

Instance Method Details

#profilePassaporteWeb::Resources::Profile

Provides a Profile resource.

Returns:


25
26
27
# File 'lib/passaporte_web/client/identity.rb', line 25

def profile
  PassaporteWeb::Resources::Profile.new(api)
end

#sign_upPassaporteWeb::Resources::SignUp

Provides a SignUp resource.

Returns:


31
32
33
# File 'lib/passaporte_web/client/identity.rb', line 31

def 
  PassaporteWeb::Resources::SignUp.new(api)
end

#widgetPassaporteWeb::Resources::Widget

Provides a Widget resource.

Returns:


37
38
39
# File 'lib/passaporte_web/client/identity.rb', line 37

def widget
  PassaporteWeb::Resources::Widget.new(api)
end