Sha256: 7796525c68b22eca251cb5a71f56e8f660f4923dd160bfa02efed15fdaf23662
Contents?: true
Size: 750 Bytes
Versions: 20
Compression:
Stored size: 750 Bytes
Contents
module ChargeBee class Environment API_VERSION = "v2" # in seconds TIME_MACHINE_TIMEOUT = 3 attr_accessor :api_key, :site, :time_machine_sleeptime attr_reader :api_endpoint def initialize(options) options[:time_machine_sleeptime] ||= TIME_MACHINE_TIMEOUT [:api_key, :site, :time_machine_sleeptime].each do |attr| instance_variable_set "@#{attr}", options[attr] end if($CHARGEBEE_DOMAIN == nil) @api_endpoint = "https://#{@site}.chargebee.com/api/#{API_VERSION}" else @api_endpoint = "#{$ENV_PROTOCOL == nil ? "http": "https"}://#{@site}.#{$CHARGEBEE_DOMAIN}/api/#{API_VERSION}" end end def api_url(url) url = @api_endpoint + url end end end
Version data entries
20 entries across 20 versions & 1 rubygems