class Onesky::Client

Attributes

api_key[RW]
api_secret[RW]
plugin_code[RW]
project_id[RW]

Public Class Methods

new(key, secret) click to toggle source
# File lib/onesky/client.rb, line 20
def initialize(key, secret)
  @api_key = key
  @api_secret = secret

  # Plugin code for custom header
  @plugin_code = 'ruby-wrapper'
end

Public Instance Methods

auth_hash() click to toggle source
# File lib/onesky/client.rb, line 28
def auth_hash
  now = Time.now.to_i

  {
    api_key: @api_key,
    timestamp: now,
    dev_hash: Digest::MD5.hexdigest(now.to_s + @api_secret)
  }
end