Sha256: 08e5e0970ec932ad6d1ed7c1c8c2b9466572165935fd536296df50c68a49ffb9

Contents?: true

Size: 455 Bytes

Versions: 1

Compression:

Stored size: 455 Bytes

Contents

module Alma
  class LoanSet

    attr_reader :total_record_count, :list

    def initialize(ws_response)
      @ws_response = ws_response
      @total_record_count = ws_response.fetch(total_record_count, 0)
      @list ||= list_results
    end

    def response_records
      @ws_response['item_loans'].fetch('item_loan',[])
    end

    def list_results
      response_records.map do |loan|
        Alma::AlmaRecord.new(loan)
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alma-0.1.0 lib/alma/loan_set.rb