Class: Envoy

Inherits:
Object
  • Object
show all
Defined in:
lib/util/util.rb

Overview

Others will be derived from it

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Envoy

Returns a new instance of Envoy.

Parameters:

  • params (defaults to: {})

    Hash

Raises:

  • ArgumentError When token is nil



56
57
58
59
60
61
62
# File 'lib/util/util.rb', line 56

def initialize(params = {})
  @debug = params.fetch(:debug, false)
  @token = params.fetch(:token, nil)
  raise ArgumentError.new 'Token can not be nil or empty' if @token.nil? || @token.to_s.empty?
  @base_url = params.fetch(:base_url, "https://api.botanalytics.co/v1/")
  @callback = params.fetch(:callback, nil)
end