Module: OpenRecycling

Defined in:
lib/open_recycling.rb,
lib/open_recycling/client.rb,
lib/open_recycling/version.rb,
lib/open_recycling/resource.rb,
lib/open_recycling/org/client.rb,
lib/open_recycling/apps/client.rb,
lib/open_recycling/core/client.rb,
lib/open_recycling/client_error.rb,
lib/open_recycling/apps/webhooks.rb,
lib/open_recycling/core/invoices.rb,
lib/open_recycling/module_client.rb,
lib/open_recycling/documents/client.rb,
lib/open_recycling/apps/applications.rb,
lib/open_recycling/documents/uploads.rb,
lib/open_recycling/org/organizations.rb,
lib/open_recycling/documents/documents.rb,
lib/open_recycling/org/organization_users.rb,
lib/open_recycling/core/recycling_accounts.rb

Defined Under Namespace

Modules: Apps, Core, Documents, Org Classes: Client, ClientError, Error, ModuleClient, Resource

Constant Summary collapse

VERSION =
"0.0.8"

Class Method Summary collapse

Class Method Details

.api_urlObject



21
22
23
# File 'lib/open_recycling.rb', line 21

def self.api_url
  @api_url
end

.api_url=(url) ⇒ Object



17
18
19
# File 'lib/open_recycling.rb', line 17

def self.api_url=(url)
  @api_url = url
end

.generate_token(application_id:, api_key:, secret_key:, application_user_id:) ⇒ Object



41
42
43
44
45
46
47
48
49
# File 'lib/open_recycling.rb', line 41

def self.generate_token(application_id:,api_key:,secret_key:,application_user_id:)
  payload = {
    sub: application_user_id,
    application_id: application_id,
    api_key: api_key
  }

  JWT.encode(payload, secret_key, "HS256")
end

.jwt_tokenObject



29
30
31
# File 'lib/open_recycling.rb', line 29

def self.jwt_token
  @jwt_token
end

.jwt_token=(token) ⇒ Object



25
26
27
# File 'lib/open_recycling.rb', line 25

def self.jwt_token=(token)
  @jwt_token = token
end

.loggerObject



37
38
39
# File 'lib/open_recycling.rb', line 37

def self.logger
  @logger ||= Logger.new(STDOUT)
end

.logger=(logger) ⇒ Object



33
34
35
# File 'lib/open_recycling.rb', line 33

def self.logger=(logger)
  @logger = logger
end