Sha256: c94b65d37aeee2065e90d509e03b16595bd6452d27c054a7855f9a8b2735ba9b

Contents?: true

Size: 628 Bytes

Versions: 3

Compression:

Stored size: 628 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
      }
    end

    def initialize(settings = {})
      settings = defaults.merge(settings)
      settings.each do |property, value|
        next unless defaults.keys.include? 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.1.12 lib/archivesspace/client/configuration.rb
archivesspace-client-0.1.11 lib/archivesspace/client/configuration.rb
archivesspace-client-0.1.10 lib/archivesspace/client/configuration.rb