Sha256: 364440c858a3ec5554e4ffc7d2be45dc29a1329a7666852c30bfa93aa6ac04a0

Contents?: true

Size: 776 Bytes

Versions: 16

Compression:

Stored size: 776 Bytes

Contents

module Chargify
  class << self
    attr_accessor :subdomain, :api_key, :site, :format, :timeout, :domain, :protocol

    def configure
      # Since site is dependent on other fields, we erase it before yielding so that it is recalculated based
      # on changes from any of the other settings
      self.site = nil

      yield self

      self.protocol  = protocol  || "https"
      self.domain    = domain    || "chargify.com"
      self.format    = format    || :xml
      self.subdomain = subdomain || "test"
      self.site      = site || "#{protocol}://#{subdomain}.#{domain}"

      Base.site      = site
      Base.user      = api_key
      Base.password  = 'X'
      Base.timeout   = timeout unless (timeout.blank?)
      Base.format    = format
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
chargify_api_ares-1.4.15 lib/chargify_api_ares/config.rb
chargify_api_ares-1.4.14 lib/chargify_api_ares/config.rb
chargify_api_ares-1.4.13 lib/chargify_api_ares/config.rb
chargify_api_ares-1.4.11 lib/chargify_api_ares/config.rb
chargify_api_ares-1.4.10 lib/chargify_api_ares/config.rb
chargify_api_ares-1.4.7 lib/chargify_api_ares/config.rb
chargify_api_ares-1.4.6 lib/chargify_api_ares/config.rb
chargify_api_ares-1.4.5 lib/chargify_api_ares/config.rb
chargify_api_ares-1.4.4 lib/chargify_api_ares/config.rb
chargify_api_ares-1.4.3 lib/chargify_api_ares/config.rb
chargify_api_ares-1.4.2 lib/chargify_api_ares/config.rb
chargify_api_ares-1.4.1 lib/chargify_api_ares/config.rb
chargify_api_ares-1.4.0 lib/chargify_api_ares/config.rb
chargify_api_ares-1.3.5 lib/chargify_api_ares/config.rb
chargify_api_ares-1.3.4 lib/chargify_api_ares/config.rb
chargify_api_ares-1.3.3 lib/chargify_api_ares/config.rb