Class: BerkeleyLibrary::Alma::BarCode

Inherits:
Object
  • Object
show all
Includes:
RecordId
Defined in:
lib/berkeley_library/alma/barcode.rb

Overview

RecordId subclass representing an item barcode.

Constant Summary

Constants included from Constants

Constants::ALMA_RECORD_RE, Constants::DEFAULT_USER_AGENT, Constants::MILLENNIUM_RECORD_RE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RecordId

#<=>, #get_marc_record, #get_marc_xml, #marc_uri, parse

Constructor Details

#initialize(barcode) ⇒ BarCode

Initialize a barcode. Since we purchase barcodes of varied formats and accept vendor barcodes as well we are only validating whether it's a string or not.



13
14
15
16
# File 'lib/berkeley_library/alma/barcode.rb', line 13

def initialize(barcode)
  string?(barcode)
  @barcode = barcode
end

Instance Attribute Details

#barcodeObject (readonly)

Returns the value of attribute barcode.



9
10
11
# File 'lib/berkeley_library/alma/barcode.rb', line 9

def barcode
  @barcode
end

Instance Method Details

#sru_query_valueString

Returns the SRU query value for this Barcode.

Returns:

  • (String)

    the Barcode query value



21
22
23
# File 'lib/berkeley_library/alma/barcode.rb', line 21

def sru_query_value
  "alma.barcode=#{@barcode}"
end