Sha256: 5ec865eb3d48679d58228b40d8edeb053967a63e235f520366c12454e3bfdaac

Contents?: true

Size: 833 Bytes

Versions: 5

Compression:

Stored size: 833 Bytes

Contents

module Universign
  class Configuration
    attr_accessor :login, :password, :endpoint, :proxy, :timeout

    def initialize
      @login    = nil
      @password = nil
      @endpoint = nil
      @proxy    = nil
      @timeout  = nil
    end
  end

  # @return [Universign::Configuration] Universign's current configuration
  def self.configuration
    @configuration ||= Configuration.new
  end

  # Set Universign's configuration
  # @param config [Universign::Configuration]
  def self.configuration=(config)
    @configuration = config
  end

  # Modify Universign's current configuration
  # @yieldparam [Universign::Configuration] config current Universign config
  # ```
  # Universign.configure do |config|
  #   config.login = "your-mail@provider.com"
  # end
  # ```
  def self.configure
    yield configuration
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruby_universign-1.6.0 lib/universign/configuration.rb
ruby_universign-1.5.1 lib/universign/configuration.rb
ruby_universign-1.5.0 lib/universign/configuration.rb
ruby_universign-1.4.0 lib/universign/configuration.rb
ruby_universign-1.3.1 lib/universign/configuration.rb