class Alma::Library
Public Class Methods
all(args: {})
click to toggle source
# File lib/alma/library.rb, line 7 def self.all(args: {}) response = HTTParty.get("#{configuration_base_path}/libraries", query: args, headers: headers, timeout: timeout) if response.code == 200 LibrarySet.new(response) else raise StandardError, get_body_from(response) end end
find(library_code:, args: {})
click to toggle source
# File lib/alma/library.rb, line 16 def self.find(library_code:, args: {}) response = HTTParty.get("#{configuration_base_path}/libraries/#{library_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/library.rb, line 25 def self.get_body_from(response) JSON.parse(response.body) end