Sha256: 33a8991e5c8deec28593878386170672ac1aa42c45f40ad2d6ad91967800581c

Contents?: true

Size: 1.93 KB

Versions: 59

Compression:

Stored size: 1.93 KB

Contents

#!/usr/bin/ruby



module Hip3
	# abstract superclass for copies and items (both serial and mono). Both a Copy
  # and an Item are Holdings. 
	# coverage_str only applies to copies and serial items, not mono items, but
	# we put it here anyway, it'll just be nil for mono items. 
	class Holding 
		attr_accessor :id, :location_str, :collection_str, :call_no, :copy_str, :status_str, :coverage_str, :notes
    # Holdings sometimes use the bib to lazy load more stuff.	
    attr_accessor :bib  
		
		# If input is nil, returns nil, else returns input.inner_text
		def textValue(el)
			return ( el == nil ? nil : el.inner_text)
		end
		
		# Return an array of holding strings, possibly empty, possibly single-valued.
		# over-ridden by SerialCopy to give you an array, since SerialCopies have
		# multiple holdings strings. 
		def coverage_str_to_a
			return coverage_str.nil? ? [] : [coverage_str]
		end

		# Some items are dummy/placeholder items which don't really represent
		# an item, and shouldn't be shown. Having trouble figuring out what
		# our 'business rules' for that are, so this is a messy guess. 
		def dummy?
			#Mostly trying to rule out the weird internet holdings
			#that tell us nothing--url is already in the bib.
      return ( collection_str == "Internet" ||
               collection_str == "Internet Resource" ||
               collection_str == "Welch Online Journals" || 
               collection_str == "Welch Online Journal" ||
               collection_str == "Gibson-Electronic Journals & Indexes" ||
               collection_str == "Gibson - Electronic Journals")
				
			#return ((  (call_no == "World Wide Web" || call_no.blank?) &&
			#		( collection_str == "Internet" || collection_str == "Welch Online Journals" || collection_str == "Welch Online Journal")) ||
			#		(collection_str == "Gibson-Electronic Journals & Indexes" && call_no="Online journal")) 
				
		end
	end

		
	
	
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
umlaut-3.0.0beta4 lib/hip3/holding.rb
umlaut-3.0.0beta3 lib/hip3/holding.rb
umlaut-3.0.0beta2 lib/hip3/holding.rb
umlaut-3.0.0beta1 lib/hip3/holding.rb
umlaut-3.0.0alpha15 lib/hip3/holding.rb
umlaut-3.0.0alpha14 lib/hip3/holding.rb
umlaut-3.0.0alpha13 lib/hip3/holding.rb
umlaut-3.0.0alpha12 lib/hip3/holding.rb
umlaut-3.0.0alpha11 lib/hip3/holding.rb
umlaut-3.0.0alpha10 lib/hip3/holding.rb
umlaut-3.0.0alpha9 lib/hip3/holding.rb
umlaut-3.0.0alpha8 lib/hip3/holding.rb
umlaut-3.0.0alpha7 lib/hip3/holding.rb
umlaut-3.0.0alpha6 lib/hip3/holding.rb
umlaut-3.0.0alpha5 lib/hip3/holding.rb
umlaut-3.0.0alpha4 lib/hip3/holding.rb
umlaut-3.0.0alpha3 lib/hip3/holding.rb
umlaut-3.0.0alpha2 lib/hip3/holding.rb
umlaut-3.0.0alpha1 lib/hip3/holding.rb