Class: Exlibris::Aleph::Patron::Record::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/exlibris/aleph/patron/record/item.rb,
lib/exlibris/aleph/patron/record/item/hold.rb,
lib/exlibris/aleph/patron/record/item/create_hold.rb,
lib/exlibris/aleph/patron/record/item/circulation_policy.rb,
lib/exlibris/aleph/patron/record/item/circulation_policy/privileges.rb

Defined Under Namespace

Classes: CirculationPolicy, CreateHold, Hold

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(patron_id, record_id, id) ⇒ Item

Returns a new instance of Item.



8
9
10
11
12
# File 'lib/exlibris/aleph/patron/record/item.rb', line 8

def initialize(patron_id, record_id, id)
  @patron_id = patron_id
  @record_id = record_id
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/exlibris/aleph/patron/record/item.rb', line 6

def id
  @id
end

#patron_idObject (readonly)

Returns the value of attribute patron_id.



6
7
8
# File 'lib/exlibris/aleph/patron/record/item.rb', line 6

def patron_id
  @patron_id
end

#record_idObject (readonly)

Returns the value of attribute record_id.



6
7
8
# File 'lib/exlibris/aleph/patron/record/item.rb', line 6

def record_id
  @record_id
end

Instance Method Details

#circulation_policyObject



25
26
27
28
# File 'lib/exlibris/aleph/patron/record/item.rb', line 25

def circulation_policy
  @circulation_policy ||=
    CirculationPolicy.new(privileges, *pickup_locations)
end

#create_hold(parameters) ⇒ Object



34
35
36
# File 'lib/exlibris/aleph/patron/record/item.rb', line 34

def create_hold(parameters)
  CreateHold.new(patron_id, record_id, id, parameters)
end

#holdObject



30
31
32
# File 'lib/exlibris/aleph/patron/record/item.rb', line 30

def hold
  @hold ||= Hold.new(patron_id, record_id, id)
end

#itemObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/exlibris/aleph/patron/record/item.rb', line 14

def item
  @item ||= Aleph::Item.new(record_id, id).tap do |item|
    client = self.send(:client)
    root = self.send(:root)
    reader = self.send(:reader)
    item.instance_eval { instance_variable_set(:@client, client) }
    item.instance_eval { instance_variable_set(:@root, root) }
    item.instance_eval { instance_variable_set(:@reader, reader) }
  end
end