Class: ABBYY::Cloud::Connection
- Inherits:
-
Object
- Object
- ABBYY::Cloud::Connection
- Defined in:
- lib/abbyy/cloud/connection.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
14 15 16 |
# File 'lib/abbyy/cloud/connection.rb', line 14 def root @root end |
Instance Method Details
#call(http_method, path, body: nil, **options) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/abbyy/cloud/connection.rb', line 16 def call(http_method, path, body: nil, **) uri = prepare_uri(path, ) req = Net::HTTP.const_get(http_method.capitalize).new(uri) req.body = body setup_headers(req, ) res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http| http.request(req) end handle_response(res) end |