Module: SyncwiseApi

Defined in:
lib/syncwise_api/ext/inflector_methods.rb,
lib/syncwise_api.rb,
lib/syncwise_api/client.rb,
lib/syncwise_api/errors.rb,
lib/syncwise_api/version.rb,
lib/syncwise_api/ext/inflections.rb,
lib/syncwise_api/requests/V1_0/base.rb,
lib/syncwise_api/service_utils/http.rb,
lib/syncwise_api/responses/V1_0/base.rb,
lib/syncwise_api/mixins/request_sender.rb,
lib/syncwise_api/mixins/request_signer.rb,
lib/syncwise_api/responses/V1_0/standard.rb,
lib/syncwise_api/requests/V1_0/user_login.rb,
lib/syncwise_api/ext/inflector/inflections.rb,
lib/syncwise_api/requests/V1_0/device_list.rb,
lib/syncwise_api/service_utils/parsers/json.rb,
lib/syncwise_api/service_utils/time_stamper.rb,
lib/syncwise_api/service_utils/encoders/json.rb,
lib/syncwise_api/requests/V1_0/device_details.rb,
lib/syncwise_api/service_utils/encoders/base64.rb,
lib/syncwise_api/requests/V1_0/device_subscribe.rb,
lib/syncwise_api/requests/V1_0/device_unsubscribe.rb,
lib/syncwise_api/requests/V1_0/trip_event_details.rb,
lib/syncwise_api/service_utils/crypto/hmac_sha256.rb,
lib/syncwise_api/requests/V1_0/driver_speed_report.rb,
lib/syncwise_api/requests/V1_0/obd_vehicle_details.rb,
lib/syncwise_api/requests/V1_0/assign_device_create.rb,
lib/syncwise_api/requests/V1_0/device_settings_edit.rb,
lib/syncwise_api/requests/V1_0/vehicle_idling_history.rb,
lib/syncwise_api/requests/V1_0/device_settings_details.rb,
lib/syncwise_api/requests/V1_0/vehicle_gauge_information.rb,
lib/syncwise_api/requests/V1_0/user_subscribe_settings_details.rb

Overview

taken lock, stock and 2 smoking barrels from rails / activesupport / lib / active_support / inflector / inflections.rb thanks again, rails team!

Defined Under Namespace

Modules: Errors, Inflector, Mixins, Requests, Responses, ServiceUtils Classes: Client

Constant Summary collapse

LOGGER =
Logger.new(STDERR)
VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.make_request(action_code, params) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/syncwise_api.rb', line 19

def make_request(action_code, params)
  if @clients
    @clients.with do |client|
      client.make_request(action_code, params)
    end
  else
    puts 'You must first call SyncwiseAPI.start(username, password) before you can call SyncwiseApi.make_request.'
  end
end

.start(username, password, number_of_clients = 1) ⇒ Object



15
16
17
# File 'lib/syncwise_api.rb', line 15

def start(username, password, number_of_clients = 1)
  @clients ||= ConnectionPool.new(size: number_of_clients, timeout: 5) { SyncwiseApi::Client.new(username, password)}
end