class Alma::Location

Public Class Methods

all(library_code:, args: {}) click to toggle source
# File lib/alma/location.rb, line 7
def self.all(library_code:, args: {})
  response = HTTParty.get("#{configuration_base_path}/libraries/#{library_code}/locations", query: args, headers: headers, timeout: timeout)
  if response.code == 200
    LocationSet.new(response)
  else
    raise StandardError, get_body_from(response)
  end
end
find(library_code:, location_code:, args: {}) click to toggle source
# File lib/alma/location.rb, line 16
def self.find(library_code:, location_code:, args: {})
  response = HTTParty.get("#{configuration_base_path}/libraries/#{library_code}/locations/#{location_code}", query: args, headers: headers, timeout: timeout)
  if response.code == 200
    AlmaRecord.new(response)
  else
    raise StandardError, get_body_from(response)
  end
end
get_body_from(response) click to toggle source
# File lib/alma/location.rb, line 25
def self.get_body_from(response)
  JSON.parse(response.body)
end