Sha256: 70143b9c107e660e7218bf859e6507f6782fb2cecdbd7f0225c92528ad596ec4

Contents?: true

Size: 642 Bytes

Versions: 3

Compression:

Stored size: 642 Bytes

Contents

# frozen_string_literal: true

module ArchivesSpace
  class Configuration
    def defaults
      {
        base_uri: "http://localhost:8089",
        base_repo: "",
        debug: false,
        username: "admin",
        password: "admin",
        page_size: 50,
        throttle: 0,
        verify_ssl: true,
        timeout: 60
      }
    end

    def initialize(settings = {})
      settings = defaults.merge(settings)
      settings.each do |property, value|
        next unless defaults.key?(property)

        instance_variable_set(:"@#{property}", value)
        self.class.send(:attr_accessor, property)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
archivesspace-client-0.4.1 lib/archivesspace/client/configuration.rb
archivesspace-client-0.4.0 lib/archivesspace/client/configuration.rb
archivesspace-client-0.3.0 lib/archivesspace/client/configuration.rb