lib/alma/loan_set.rb in alma-0.2.4 vs lib/alma/loan_set.rb in alma-0.2.5

- old
+ new

@@ -1,18 +1,29 @@ module Alma - class LoanSet < ResultSet + class LoanSet + extend Forwardable + include Enumerable + #include Alma::Error + attr_reader :response + def_delegators :list, :each, :size + def_delegators :response, :[], :fetch - def top_level_key - 'item_loans' + def initialize(response_body_hash) + @response = response_body_hash end - def response_records_key + def list + fetch(key, []) + end + + def key 'item_loan' end - def single_record_class - Alma::Loan + def total_record_count + fetch('total_record_count', 0) end + alias :total_records :total_record_count end end