Sha256: 75282d407d4d8df6d5ace21dc33c8b7d6af491bc2a52445bde2fcc0a9091011c
Contents?: true
Size: 736 Bytes
Versions: 7
Compression:
Stored size: 736 Bytes
Contents
module Voyager class Collection attr_reader :holdings, :holdings_status def initialize(args = {}) @connection = args[:connection] || raise("Must pass a connection") @bibid = args[:bibid] || raise("Must pass a bibid") @bibid = @bibid.to_s parse_results end def to_hash(args = {}) { statuses: @holdings_status.to_hash(args) } end private def parse_results results = @connection.results['retrieve_holdings'][@bibid.to_s] @holdings = {} @holdings = results.reject { |r| r["MFHD_ID"].nil? } if results status = Status.new(@holdings) @holdings_status = status end end end
Version data entries
7 entries across 7 versions & 1 rubygems