Class: Tempest::XRPCClient

Inherits:
Object
  • Object
show all
Defined in:
lib/tempest/xrpc_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(session) ⇒ XRPCClient

Returns a new instance of XRPCClient.



6
7
8
# File 'lib/tempest/xrpc_client.rb', line 6

def initialize(session)
  @session = session
end

Instance Method Details

#get(nsid, query: nil) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/tempest/xrpc_client.rb', line 10

def get(nsid, query: nil)
  perform { |access_jwt|
    Tempest::HTTP.get_json(
      endpoint(nsid),
      headers: auth_headers(access_jwt),
      query: query,
    )
  }
end

#post(nsid, body:) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/tempest/xrpc_client.rb', line 20

def post(nsid, body:)
  perform { |access_jwt|
    Tempest::HTTP.post_json(
      endpoint(nsid),
      headers: auth_headers(access_jwt),
      body: body,
    )
  }
end