Class: Exlibris::Aleph::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/exlibris/aleph/item.rb,
lib/exlibris/aleph/item/queue.rb,
lib/exlibris/aleph/item/status.rb,
lib/exlibris/aleph/item/opac_note.rb,
lib/exlibris/aleph/item/call_number.rb,
lib/exlibris/aleph/item/display_mask.rb,
lib/exlibris/aleph/item/processing_status.rb,
lib/exlibris/aleph/item/circulation_policy.rb,
lib/exlibris/aleph/item/circulation_status.rb,
lib/exlibris/aleph/item/circulation_policy/display.rb,
lib/exlibris/aleph/item/circulation_policy/identifier.rb,
lib/exlibris/aleph/item/circulation_policy/privileges.rb

Defined Under Namespace

Classes: CallNumber, CirculationPolicy, CirculationStatus, DisplayMask, OpacNote, ProcessingStatus, Queue, Status

Constant Summary collapse

ON_SHELF_VALUES =
['On Shelf']

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record_id, id) ⇒ Item

Returns a new instance of Item.


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

def initialize(record_id, 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/item.rb', line 6

def id
  @id
end

#record_idObject (readonly)

Returns the value of attribute record_id


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

def record_id
  @record_id
end

Instance Method Details

#call_numberObject


20
21
22
23
24
25
# File 'lib/exlibris/aleph/item.rb', line 20

def call_number
  unless client.error?
    @call_number ||=
      CallNumber.new(reader.classification, reader.description)
  end
end

#circulation_policyObject


63
64
65
66
67
68
# File 'lib/exlibris/aleph/item.rb', line 63

def circulation_policy
  unless client.error?
    @circulation_policy ||=
      circulation_policies.find_by_identifier(circulation_policy_identifier)
  end
end

#circulation_statusObject


27
28
29
30
31
32
# File 'lib/exlibris/aleph/item.rb', line 27

def circulation_status
  unless client.error?
    @circulation_status ||=
      CirculationStatus.new(reader.circulation_status_value)
  end
end

#collectionObject


13
14
15
16
17
18
# File 'lib/exlibris/aleph/item.rb', line 13

def collection
  unless client.error?
    @collection ||=
      Collection.new(collection_code, collection_display, sub_library)
  end
end

#on_shelf?Boolean

Returns:

  • (Boolean)

59
60
61
# File 'lib/exlibris/aleph/item.rb', line 59

def on_shelf?
  !client.error? && ON_SHELF_VALUES.include?(circulation_status.value)
end

#opac_noteObject


47
48
49
50
51
# File 'lib/exlibris/aleph/item.rb', line 47

def opac_note
  unless client.error?
    @opac_note ||= OpacNote.new(reader.opac_note)
  end
end

#processing_statusObject


40
41
42
43
44
45
# File 'lib/exlibris/aleph/item.rb', line 40

def processing_status
  unless client.error?
    @processing_status ||=
      ProcessingStatus.new(processing_status_code, processing_status_display)
  end
end

#queueObject


53
54
55
56
57
# File 'lib/exlibris/aleph/item.rb', line 53

def queue
  unless client.error?
    @queue ||= Queue.new(reader.queue)
  end
end

#statusObject


34
35
36
37
38
# File 'lib/exlibris/aleph/item.rb', line 34

def status
  unless client.error?
    @status ||= Status.new(status_code, status_display)
  end
end