class Alma::ResultSet
Attributes
response[R]
Public Class Methods
new(response_body_hash)
click to toggle source
# File lib/alma/result_set.rb, line 15 def initialize(response_body_hash) @response = response_body_hash end
Public Instance Methods
each()
click to toggle source
# File lib/alma/result_set.rb, line 24 def each @results ||= @response.fetch(key, []) .map { |item| single_record_class.new(item) } end
loggable()
click to toggle source
# File lib/alma/result_set.rb, line 19 def loggable { uri: @response&.request&.uri&.to_s } .select { |k, v| !(v.nil? || v.empty?) } end
total_record_count()
click to toggle source
# File lib/alma/result_set.rb, line 29 def total_record_count fetch("total_record_count", 0).to_i end
Also aliased as: total_records
Protected Instance Methods
key()
click to toggle source
# File lib/alma/result_set.rb, line 35 def key raise NotImplementedError "Subclasses of ResultSet need to define a response key" end
single_record_class()
click to toggle source
# File lib/alma/result_set.rb, line 39 def single_record_class Alma::AlmaRecord end