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-4.1.7 app/models/hip3/holding.rb
umlaut-4.1.6 app/models/hip3/holding.rb
umlaut-4.1.5 app/models/hip3/holding.rb
umlaut-4.1.4 app/models/hip3/holding.rb
umlaut-4.1.3 app/models/hip3/holding.rb
umlaut-4.1.2 app/models/hip3/holding.rb
umlaut-4.1.1 app/models/hip3/holding.rb
umlaut-4.1.0 app/models/hip3/holding.rb
umlaut-4.1.0.pre3 app/models/hip3/holding.rb
umlaut-4.1.0.pre.2 app/models/hip3/holding.rb
umlaut-4.1.0.pre.alpha.1 app/models/hip3/holding.rb
umlaut-4.0.3 app/models/hip3/holding.rb
umlaut-4.0.2 app/models/hip3/holding.rb
umlaut-4.0.1 app/models/hip3/holding.rb
umlaut-4.0.0 app/models/hip3/holding.rb
umlaut-4.0.0.beta5 app/models/hip3/holding.rb
umlaut-4.0.0.beta4 app/models/hip3/holding.rb
umlaut-4.0.0.beta3 app/models/hip3/holding.rb
umlaut-4.0.0.beta2 app/models/hip3/holding.rb
umlaut-4.0.0.beta1 app/models/hip3/holding.rb