Sha256: a210ba67467c915dbd4c00e8afc8618e7fa57dde9fd8f41d3b94548ee1fdeeb2

Contents?: true

Size: 1.07 KB

Versions: 3

Compression:

Stored size: 1.07 KB

Contents

module Exlibris
  module Aleph
    class Patron
      class Record
        class Item
          class CreateHold
            attr_reader :patron_id, :record_id, :item_id, :parameters

            def initialize(patron_id, record_id, item_id, parameters)
              @patron_id = patron_id
              @record_id = record_id
              @item_id = item_id
              @parameters =
                API::Client::Patron::Record::Item::CreateHold::Parameters.new(parameters)
            end

            def note
              @note ||= reader.note
            end

            def error?
              reader.type == 'error'
            end

            private
            def client
              @client ||=
                API::Client::Patron::Record::Item::CreateHold.new(patron_id, record_id, item_id, parameters)
            end

            def root
              @root ||= client.root
            end

            def reader
              @reader ||= API::Reader::Patron::Record::Item::CreateHold.new(root)
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
exlibris-aleph-2.0.4 lib/exlibris/aleph/patron/record/item/create_hold.rb
exlibris-aleph-2.0.3 lib/exlibris/aleph/patron/record/item/create_hold.rb
exlibris-aleph-2.0.0 lib/exlibris/aleph/patron/record/item/create_hold.rb