Sha256: de650b4049cc858d0798c62d91d33b98f99ab430496bdbe4e707ac3dc0c4acc8

Contents?: true

Size: 875 Bytes

Versions: 17

Compression:

Stored size: 875 Bytes

Contents

# frozen_string_literal: true

module PriceHubble
  # The configuration for the pricehubble gem.
  class Configuration
    include ActiveSupport::Configurable

    # Configure the API authentication credentials
    config_accessor(:username) { ENV.fetch('PRICEHUBBLE_USERNAME', nil) }
    config_accessor(:password) { ENV.fetch('PRICEHUBBLE_PASSWORD', nil) }

    # The base URL of the API (there is no staging/canary
    # endpoint we know about)
    config_accessor(:base_url) do
      val = ENV.fetch('PRICEHUBBLE_BASE_URL', 'https://api.pricehubble.com')
      val.strip.chomp('/')
    end

    # The logger instance to use (when available we use the +Rails.logger+)
    config_accessor(:logger) do
      next(Rails.logger) if defined? Rails

      Logger.new($stdout)
    end

    # Enable request logging or not
    config_accessor(:request_logging) { true }
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
pricehubble-1.5.1 lib/price_hubble/configuration.rb
pricehubble-1.5.0 lib/price_hubble/configuration.rb
pricehubble-1.4.0 lib/price_hubble/configuration.rb
pricehubble-1.3.0 lib/price_hubble/configuration.rb
pricehubble-1.2.5 lib/price_hubble/configuration.rb
pricehubble-1.2.4 lib/price_hubble/configuration.rb
pricehubble-1.2.3 lib/price_hubble/configuration.rb
pricehubble-1.2.2 lib/price_hubble/configuration.rb
pricehubble-1.2.1 lib/price_hubble/configuration.rb
pricehubble-1.2.0 lib/price_hubble/configuration.rb
pricehubble-1.1.0 lib/pricehubble/configuration.rb
pricehubble-1.0.0 lib/pricehubble/configuration.rb
pricehubble-0.4.2 lib/pricehubble/configuration.rb
pricehubble-0.4.1 lib/pricehubble/configuration.rb
pricehubble-0.4.0 lib/pricehubble/configuration.rb
pricehubble-0.3.0 lib/pricehubble/configuration.rb
pricehubble-0.2.0 lib/pricehubble/configuration.rb