Class: Chatoperastore::AbstractClient

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

Direct Known Subclasses

QuotaWdClient

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAbstractClient

Returns a new instance of AbstractClient.



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/chatoperastore.rb', line 34

def initialize
  super
  if ENV.has_key?(LICENSE_STORE_PROVIDER) && !ENV[LICENSE_STORE_PROVIDER].strip.empty?
    @base_url = ENV[LICENSE_STORE_PROVIDER].strip

    if @base_url.end_with?("/")
      @base_url = @base_url.chop
    end

    unless VALID_BASEURLS.include?(@base_url)
      raise InvalidProviderError.new "Invalid Base Url value for chatopera store."
    end
  else
    @base_url = "https://store.chatopera.com"
  end
end

Instance Attribute Details

#base_urlObject

Returns the value of attribute base_url.



32
33
34
# File 'lib/chatoperastore.rb', line 32

def base_url
  @base_url
end