Sha256: b5ac9dc1549089e96f14db4f980a7ed69f8b4da27b6713cee84e68aced5448d2
Contents?: true
Size: 1.59 KB
Versions: 11
Compression:
Stored size: 1.59 KB
Contents
module SsciInc class Configuration attr_accessor :base_uri, :report_uri, :site_identifier, :account_code, :user_name, :password, :postback_url, :postback_username, :postback_password def base_uri @base_uri ||= 'https://linxml.com/bgcheck.asp' end def report_uri @report_uri ||= 'https://linxml.com/get_bgreport.asp' end end class << self attr_accessor :configuration def configuration @configuration ||= Configuration.new end end # Public: Configure ssci inc gem # # Examples # SsciInc.configure do |config| # base_uri: ******** # report_uri: ******** # site_identifier: ******** # account_code: ******** # user_name: ******** # password: ******** # postback_url: ******** # postback_username: ******** # postback_password: ******** # end # def self.configure yield(configuration) end # Public: Configure ssci inc gem with yaml file # # file - The name of the file to parse. (optional) # Defaults to "config/ssci_inc.yml". # # Examples # SsciInc.load_config("ssci_inc.yml") # def self.load_config(file="config/ssci_inc.yml") if File.exists?(file) h = YAML::load(IO.read(file)) load_config_hash(h) end end def self.load_config_hash(h) configure do |config| h.each do |k,v| config.send("#{k}=", v) if config.respond_to?("#{k}=") end end end end
Version data entries
11 entries across 11 versions & 1 rubygems