Class: PennMARC::InventoryEntry::Physical

Inherits:
Base
  • Object
show all
Defined in:
lib/pennmarc/helpers/inventory_entry/physical.rb

Overview

Represent a Physical inventory entry

Instance Attribute Summary

Attributes inherited from Base

#field, #mapper, #source

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PennMARC::InventoryEntry::Base

Instance Method Details

#call_numString (frozen)

Call number from inventory entry



11
12
13
14
15
16
17
# File 'lib/pennmarc/helpers/inventory_entry/physical.rb', line 11

def call_num
  if source == :pub
    "#{field[mapper::HOLDING_CLASSIFICATION_PART]}#{field[mapper::HOLDING_ITEM_PART]}"
  elsif source == :api
    field[mapper::PHYS_CALL_NUMBER]
  end
end

#priorityString?

Note:

we currently don’t return priority in our publishing enrichment

Priority for inventory entry



22
23
24
25
26
# File 'lib/pennmarc/helpers/inventory_entry/physical.rb', line 22

def priority
  return nil if source == :pub

  field[mapper::PHYS_PRIORITY]
end

#to_hHash{Symbol->Unknown



29
30
31
32
33
34
35
# File 'lib/pennmarc/helpers/inventory_entry/physical.rb', line 29

def to_h
  { holding_id: field[mapper::PHYS_HOLDING_ID],
    location_name: field[mapper::PHYS_LOCATION_NAME],
    location_code: field[mapper::PHYS_LOCATION_CODE],
    call_num: call_num,
    priority: priority }
end