Class: SynapsePayRest::ClientEndpoint
- Inherits:
-
Object
- Object
- SynapsePayRest::ClientEndpoint
- Defined in:
- lib/synapse_pay_rest/api/client.rb
Overview
Wrapper class for /client endpoint
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(client) ⇒ ClientEndpoint
constructor
A new instance of ClientEndpoint.
-
#issue_public_key(scope: "OAUTH|POST,USERS|POST,USERS|GET,USER|GET,USER|PATCH,SUBSCRIPTIONS|GET,SUBSCRIPTIONS|POST,SUBSCRIPTION|GET,SUBSCRIPTION|PATCH,CLIENT|REPORTS,CLIENT|CONTROLS") ⇒ Hash
Sends a GET request to /client endpoint to issue public key, and returns the response.
Constructor Details
#initialize(client) ⇒ ClientEndpoint
Returns a new instance of ClientEndpoint.
10 11 12 |
# File 'lib/synapse_pay_rest/api/client.rb', line 10 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ SynapsePayRest::HTTPClient
7 8 9 |
# File 'lib/synapse_pay_rest/api/client.rb', line 7 def client @client end |
Instance Method Details
#issue_public_key(scope: "OAUTH|POST,USERS|POST,USERS|GET,USER|GET,USER|PATCH,SUBSCRIPTIONS|GET,SUBSCRIPTIONS|POST,SUBSCRIPTION|GET,SUBSCRIPTION|PATCH,CLIENT|REPORTS,CLIENT|CONTROLS") ⇒ Hash
Sends a GET request to /client endpoint to issue public key, and returns the response.
HTTP response from API
23 24 25 26 27 |
# File 'lib/synapse_pay_rest/api/client.rb', line 23 def issue_public_key(scope: "OAUTH|POST,USERS|POST,USERS|GET,USER|GET,USER|PATCH,SUBSCRIPTIONS|GET,SUBSCRIPTIONS|POST,SUBSCRIPTION|GET,SUBSCRIPTION|PATCH,CLIENT|REPORTS,CLIENT|CONTROLS") path = '/client?issue_public_key=YES' path += "&scope=#{scope}" client.get(path) end |