Sha256: a2bcfa4752766022e50311cb2f421d2914ed0bc9bdb2cb56889c1fad064ccc74
Contents?: true
Size: 863 Bytes
Versions: 6
Compression:
Stored size: 863 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
6 entries across 6 versions & 1 rubygems