Sha256: eb9d2f48871a8cb5fa40cf656c940c33f7db90c66190d81dbe89d2a9ff5fe7ad

Contents?: true

Size: 1.67 KB

Versions: 1

Compression:

Stored size: 1.67 KB

Contents

require "active_support"
require "active_support/core_ext"
require "aleph_api"
require "skala/adapter"

class Skala::AlephAdapter < Skala::Adapter
  require_relative "aleph_adapter/authenticate_user"
  require_relative "aleph_adapter/create_user_hold_request"
  require_relative "aleph_adapter/delete_user_hold_request"
  #require_relative "aleph_adapter/get_record"
  require_relative "aleph_adapter/get_record_holdable_items"
  require_relative "aleph_adapter/get_record_items"
  require_relative "aleph_adapter/get_user"
  require_relative "aleph_adapter/get_user_former_loans"
  require_relative "aleph_adapter/get_user_hold_requests"
  require_relative "aleph_adapter/get_user_inter_library_loans"
  require_relative "aleph_adapter/get_user_loans"
  require_relative "aleph_adapter/get_user_transactions"
  require_relative "aleph_adapter/renew_user_loan"
  require_relative "aleph_adapter/renew_user_loans"
  require_relative "aleph_adapter/update_user"

  attr_accessor :default_document_base
  attr_accessor :default_user_library
  attr_accessor :restful_api_url
  attr_accessor :x_services_url

  def initialize(options = {})
    HashWithIndifferentAccess.new(options).try do |_options|
      self.default_document_base = _options[:default_document_base]
      self.default_user_library = _options[:default_user_library]
      self.restful_api_url = _options[:restful_api_url]
      self.x_services_url = _options[:x_services_url]
    end
  end

  #
  # apis used to implemented the operations
  #
  def restful_api
    @restful_api ||= AlephApi::RestfulApiClient.new(url: @restful_api_url)
  end

  def x_services
    @x_services ||= AlephApi::XServicesClient.new(url: @x_services_url)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
skala-1.1.0 lib/skala/aleph_adapter.rb