Class: Bakong::OpenApi::Connection
- Inherits:
-
Object
- Object
- Bakong::OpenApi::Connection
- Defined in:
- lib/bakong/open_api/connection.rb
Overview
Net::HTTP-based HTTP transport. Knows nothing about Bakong domain semantics — just turns (method, path, body) into a parsed Hash or raises a Bakong::OpenApi::Error.
Instance Method Summary collapse
- #get(path, params: nil, headers: {}) ⇒ Object
-
#initialize(config) ⇒ Connection
constructor
A new instance of Connection.
- #post(path, body: nil, headers: {}) ⇒ Object
Constructor Details
#initialize(config) ⇒ Connection
Returns a new instance of Connection.
15 16 17 |
# File 'lib/bakong/open_api/connection.rb', line 15 def initialize(config) @config = config end |
Instance Method Details
#get(path, params: nil, headers: {}) ⇒ Object
19 20 21 |
# File 'lib/bakong/open_api/connection.rb', line 19 def get(path, params: nil, headers: {}) request(:get, path, params: params, headers: headers) end |
#post(path, body: nil, headers: {}) ⇒ Object
23 24 25 |
# File 'lib/bakong/open_api/connection.rb', line 23 def post(path, body: nil, headers: {}) request(:post, path, body: body, headers: headers) end |