Class: SelfSDK::Services::Identity

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

Overview

Input class to request for identities and apps

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ SelfSDK::Services::Identity

Creates a new identity service. Identity service allows you request information for your connected users / apps.

Parameters:

  • client (SelfSDK::Client)

    http client object.



17
18
19
# File 'lib/services/identity.rb', line 17

def initialize(client)
  @client = client
end

Instance Method Details

#devices(selfid) ⇒ Array

Gets registered devices for a self identity

Parameters:

  • selfid (String)

    identity/app selfID

Returns:

  • (Array)

    array of device ids for the given selfid



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

def devices(selfid)
  @client.devices(selfid)
end

#get(selfid) ⇒ Hash

Gets an app/identity details

Parameters:

  • selfid (String)

    gets the identity details (app/user)

Returns:

  • (Hash)

    with identity details



42
43
44
# File 'lib/services/identity.rb', line 42

def get(selfid)
  @client.entity(selfid)
end

#public_key(selfid, kid) ⇒ Array

Gets an identity public keys

Parameters:

  • selfid (String)

    gets the identity details (app/user)

  • kid (String)

    the public key id.

Returns:

  • (Array)

    with the identity public keys



34
35
36
# File 'lib/services/identity.rb', line 34

def public_key(selfid, kid)
  @client.public_key(selfid, kid).public_key
end