Class: Skala::AlephAdapter

Inherits:
Adapter
  • Object
show all
Defined in:
lib/skala/aleph_adapter.rb

Defined Under Namespace

Modules: ResolveUser Classes: AuthenticateUser, CreateUserHoldRequest, DeleteUserHoldRequest, GetRecord, GetRecordHoldableItems, GetRecordItems, GetUser, GetUserFormerLoans, GetUserHoldRequests, GetUserInterLibraryLoans, GetUserLoans, GetUserTransactions, RenewUserLoan, RenewUserLoans, UpdateUser

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Adapter

#authenticate_user, #create_user_hold_request, #delete_user_hold_request, #get_record_holdable_items, #get_record_items, #get_records, #get_user, #get_user_cash, #get_user_former_loans, #get_user_hold_requests, #get_user_inter_library_loans, #get_user_loans, #get_user_transactions, #renew_user_loan, #renew_user_loans, #search, #update_user

Constructor Details

#initialize(options = {}) ⇒ AlephAdapter

Returns a new instance of AlephAdapter.



28
29
30
31
32
33
34
35
# File 'lib/skala/aleph_adapter.rb', line 28

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

Instance Attribute Details

#default_document_baseObject

Returns the value of attribute default_document_base.



23
24
25
# File 'lib/skala/aleph_adapter.rb', line 23

def default_document_base
  @default_document_base
end

#default_user_libraryObject

Returns the value of attribute default_user_library.



24
25
26
# File 'lib/skala/aleph_adapter.rb', line 24

def default_user_library
  @default_user_library
end

#restful_api_urlObject

Returns the value of attribute restful_api_url.



25
26
27
# File 'lib/skala/aleph_adapter.rb', line 25

def restful_api_url
  @restful_api_url
end

#x_services_urlObject

Returns the value of attribute x_services_url.



26
27
28
# File 'lib/skala/aleph_adapter.rb', line 26

def x_services_url
  @x_services_url
end

Instance Method Details

#restful_apiObject

apis used to implemented the operations



40
41
42
# File 'lib/skala/aleph_adapter.rb', line 40

def restful_api
  @restful_api ||= AlephApi::RestfulApiClient.new(url: @restful_api_url)
end

#x_servicesObject



44
45
46
# File 'lib/skala/aleph_adapter.rb', line 44

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