Class: PlatformSdk::Central::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/platform_sdk/central/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url, access_token, conn: nil) ⇒ Client

Returns a new instance of Client.



6
7
8
9
10
# File 'lib/platform_sdk/central/client.rb', line 6

def initialize(base_url, access_token, conn: nil)
  @access_token = access_token
  @base_url = base_url
  @conn = conn || build_connection
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



4
5
6
# File 'lib/platform_sdk/central/client.rb', line 4

def access_token
  @access_token
end

#base_urlObject (readonly)

Returns the value of attribute base_url.



4
5
6
# File 'lib/platform_sdk/central/client.rb', line 4

def base_url
  @base_url
end

#connObject (readonly)

Returns the value of attribute conn.



4
5
6
# File 'lib/platform_sdk/central/client.rb', line 4

def conn
  @conn
end

Instance Method Details

#user(uid) ⇒ Object



12
13
14
15
16
# File 'lib/platform_sdk/central/client.rb', line 12

def user(uid)
  resource_path = "/api/users/#{uid}"
  response = get(resource_path)
  response.body
end