Class: Hip3::Holding

Inherits:
Object
  • Object
show all
Defined in:
lib/hip3/holding.rb

Overview

we put it here anyway, it’ll just be nil for mono items.

Direct Known Subclasses

SerialCopy

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bibObject

Holdings sometimes use the bib to lazy load more stuff.



13
14
15
# File 'lib/hip3/holding.rb', line 13

def bib
  @bib
end

#call_noObject

Returns the value of attribute call_no.



11
12
13
# File 'lib/hip3/holding.rb', line 11

def call_no
  @call_no
end

#collection_strObject

Returns the value of attribute collection_str.



11
12
13
# File 'lib/hip3/holding.rb', line 11

def collection_str
  @collection_str
end

#copy_strObject

Returns the value of attribute copy_str.



11
12
13
# File 'lib/hip3/holding.rb', line 11

def copy_str
  @copy_str
end

#coverage_strObject

Returns the value of attribute coverage_str.



11
12
13
# File 'lib/hip3/holding.rb', line 11

def coverage_str
  @coverage_str
end

#idObject

Returns the value of attribute id.



11
12
13
# File 'lib/hip3/holding.rb', line 11

def id
  @id
end

#location_strObject

Returns the value of attribute location_str.



11
12
13
# File 'lib/hip3/holding.rb', line 11

def location_str
  @location_str
end

#notesObject

Returns the value of attribute notes.



11
12
13
# File 'lib/hip3/holding.rb', line 11

def notes
  @notes
end

#status_strObject

Returns the value of attribute status_str.



11
12
13
# File 'lib/hip3/holding.rb', line 11

def status_str
  @status_str
end

Instance Method Details

#coverage_str_to_aObject

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.



23
24
25
# File 'lib/hip3/holding.rb', line 23

def coverage_str_to_a
	return coverage_str.nil? ? [] : [coverage_str]
end

#dummy?Boolean

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.

Returns:

  • (Boolean)


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/hip3/holding.rb', line 30

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

#textValue(el) ⇒ Object

If input is nil, returns nil, else returns input.inner_text



16
17
18
# File 'lib/hip3/holding.rb', line 16

def textValue(el)
	return ( el == nil ? nil : el.inner_text)
end