Sha256: d0cff98d13a647d08224e0a25f13ecfe5f339f11a39b5570aa66ec568b867870
Contents?: true
Size: 729 Bytes
Versions: 3
Compression:
Stored size: 729 Bytes
Contents
require 'json' module WialonApi module Api def self.call(service_name, args = {}, sid = nil) parameters = { svc: service_name, params: args.to_json, WialonApi.wialon_session_identifier => sid } connection(url: WialonApi.wialon_host).send(WialonApi.http_verb, nil, parameters).body end def self.connection(options = {}) url = options.delete(:url) Faraday.new(url, WialonApi.faraday_options) do |builder| builder.request :url_encoded builder.request :retry, WialonApi.max_retries builder.response :wialon_logger builder.response :mashify builder.response :oj, preserve_raw: true builder.adapter WialonApi.adapter end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
wialon_api-0.0.8 | lib/wialon_api/api.rb |
wialon_api-0.0.7 | lib/wialon_api/api.rb |
wialon_api-0.0.6 | lib/wialon_api/api.rb |