Sha256: 7816db8a27e6410a36cc9a90c34aef652029ea57d6eaa375a1ed0866bae9fede
Contents?: true
Size: 864 Bytes
Versions: 31
Compression:
Stored size: 864 Bytes
Contents
module ChargeBee class Environment API_VERSION = "v2" # in seconds TIME_MACHINE_TIMEOUT = 3 EXPORT_TIMEOUT = 10 attr_accessor :api_key, :site, :time_machine_sleeptime, :export_sleeptime attr_reader :api_endpoint def initialize(options) options[:time_machine_sleeptime] ||= TIME_MACHINE_TIMEOUT options[:export_sleeptime] ||= EXPORT_TIMEOUT [:api_key, :site, :time_machine_sleeptime, :export_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
31 entries across 31 versions & 1 rubygems