Sha256: 1cd0b0266124835584836b2b4307f9b1d690b33d3eebaaa2218de3ca155359f9
Contents?: true
Size: 1.07 KB
Versions: 18
Compression:
Stored size: 1.07 KB
Contents
module Access class << self attr_accessor :config end def self.config @config && @config.access_token ? @config : @config = Config.new end # Set options via block def self.configure yield(config) if block_given? end class Config DOMAINS = {'production' => '', 'demo' => '-demo', 'stage' => '-stage', 'staging' => '-stage' } attr_accessor :access_token, :api_environment, :return_json, :hashify def initialize @access_token = ENV['ACCESS_TOKEN'] # demo, stage, production @api_environment = ENV['ACCESS_ENVIRONMENT'] || 'demo' # @api_version = ENV['ACCESS_VERSION'] || 'v1' @return_json = ENV['ACCESS_RETURN_JSON'] || 'false' # only used when return_json is true @hashify = ENV['ACCESS_HASHIFY'] || 'false' end def reset self.access_token = ENV['ACCESS_TOKEN'] self.api_environment = ENV['ACCESS_ENVIRONMENT'] || 'demo' # self.api_version = 'v1' self.return_json = ENV['ACCESS_RETURN_JSON'] || 'false' self.hashify = ENV['ACCESS_HASHIFY'] || 'false' end end end
Version data entries
18 entries across 18 versions & 1 rubygems