Class: Rocksky::HTTP
- Inherits:
-
Object
- Object
- Rocksky::HTTP
- Defined in:
- lib/rocksky/http.rb
Overview
Low-level XRPC transport. Most users should go through the resource accessors on Client (e.g. ‘client.actor.get_profile(…)`).
Constant Summary collapse
- DEFAULT_OPEN_TIMEOUT =
10- DEFAULT_READ_TIMEOUT =
30
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(client) ⇒ HTTP
constructor
A new instance of HTTP.
-
#procedure(nsid, params = {}, body = nil) ⇒ Object
POST /xrpc/<nsid>?…
-
#query(nsid, params = {}) ⇒ Object
GET /xrpc/<nsid>?…
Constructor Details
#initialize(client) ⇒ HTTP
Returns a new instance of HTTP.
14 15 16 |
# File 'lib/rocksky/http.rb', line 14 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
12 13 14 |
# File 'lib/rocksky/http.rb', line 12 def client @client end |
Instance Method Details
#procedure(nsid, params = {}, body = nil) ⇒ Object
POST /xrpc/<nsid>?… with optional JSON body.
24 25 26 |
# File 'lib/rocksky/http.rb', line 24 def procedure(nsid, params = {}, body = nil) request(method: :post, nsid: nsid, params: params, body: body) end |
#query(nsid, params = {}) ⇒ Object
GET /xrpc/<nsid>?…
19 20 21 |
# File 'lib/rocksky/http.rb', line 19 def query(nsid, params = {}) request(method: :get, nsid: nsid, params: params) end |