lib/archivesspace/client/client.rb in archivesspace-client-0.1.6 vs lib/archivesspace/client/client.rb in archivesspace-client-0.1.7

- old
+ new

@@ -1,16 +1,16 @@ -module ArchivesSpace +# frozen_string_literal: true +module ArchivesSpace class Client include Helpers attr_accessor :token attr_reader :config def initialize(config = Configuration.new) - unless config.kind_of? ArchivesSpace::Configuration - raise "Invalid configuration object" - end + raise 'Invalid configuration object' unless config.is_a? ArchivesSpace::Configuration + @config = config @token = nil end def get(path, options = {}) @@ -31,13 +31,11 @@ private def request(method, path, options = {}) sleep config.throttle - options[:headers] = { "X-ArchivesSpace-Session" => token } if token + options[:headers] = { 'X-ArchivesSpace-Session' => token } if token result = Request.new(config, method, path, options).execute Response.new result end - end - end