Module: Vufer

Extended by:
Configure
Defined in:
lib/vufer.rb,
lib/vufer/target.rb,
lib/vufer/version.rb,
lib/vufer/configure.rb,
lib/vufer/signature.rb

Defined Under Namespace

Modules: Configure Classes: Error, KeyEnvironmentError, Signature, Target

Constant Summary collapse

BASE_URI =
'https://vws.vuforia.com'.freeze
VERSION =
'1.0.2'

Class Method Summary collapse

Methods included from Configure

access_key, access_key=, configure, secret_key, secret_key=, use_defaults

Class Method Details

.summaryObject

Returns a summary from targets, quota and images from Vuforia.



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/vufer.rb', line 21

def summary
  time = Time.now.httpdate
  signature = Vufer::Signature.generate('/summary', nil, 'GET', time)

  res = Faraday.get("#{Vufer::BASE_URI}/summary", {}, {
    'Date': time,
    'Authorization': "VWS #{Vufer.access_key}:#{signature}"
  })

  JSON.parse(res.body)
rescue StandardError => e
  e.message
end