Class: PlatformSdk::Central::Client
- Inherits:
-
Object
- Object
- PlatformSdk::Central::Client
- Defined in:
- lib/platform_sdk/central/client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#conn ⇒ Object
readonly
Returns the value of attribute conn.
Instance Method Summary collapse
-
#initialize(base_url, access_token, conn: nil) ⇒ Client
constructor
A new instance of Client.
- #user(uid) ⇒ Object
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_token ⇒ Object (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_url ⇒ Object (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 |
#conn ⇒ Object (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 |