Module: Skala::AlephAdapter::ResolveUser

Defined in:
lib/skala/aleph_adapter/resolve_user.rb

Instance Method Summary collapse

Instance Method Details

#resolve_user(username, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/skala/aleph_adapter/resolve_user.rb', line 5

def resolve_user(username, options = {})
  username = username.upcase
  user_library = options[:user_library] || adapter.default_user_library

  x_services_result = adapter.x_services.post(
    op: "bor-by-key",
    bor_id: username,
    library: user_library
  )

  x_services_result.match(/<internal-id>(.*)<\/internal-id>/) do |_match_data|
    _match_data.captures.first
  end
end