Class: Hip3::Holding
- Inherits:
-
Object
- Object
- Hip3::Holding
- Defined in:
- lib/hip3/holding.rb
Overview
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.
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (Object) bib
Holdings sometimes use the bib to lazy load more stuff.
-
- (Object) call_no
Returns the value of attribute call_no.
-
- (Object) collection_str
Returns the value of attribute collection_str.
-
- (Object) copy_str
Returns the value of attribute copy_str.
-
- (Object) coverage_str
Returns the value of attribute coverage_str.
-
- (Object) id
Returns the value of attribute id.
-
- (Object) location_str
Returns the value of attribute location_str.
-
- (Object) notes
Returns the value of attribute notes.
-
- (Object) status_str
Returns the value of attribute status_str.
Instance Method Summary (collapse)
-
- (Object) coverage_str_to_a
Return an array of holding strings, possibly empty, possibly single-valued.
-
- (Boolean) dummy?
Some items are dummy/placeholder items which don't really represent an item, and shouldn't be shown.
-
- (Object) textValue(el)
If input is nil, returns nil, else returns input.inner_text.
Instance Attribute Details
- (Object) bib
Holdings sometimes use the bib to lazy load more stuff.
13 14 15 |
# File 'lib/hip3/holding.rb', line 13 def bib @bib end |
- (Object) call_no
Returns the value of attribute call_no
11 12 13 |
# File 'lib/hip3/holding.rb', line 11 def call_no @call_no end |
- (Object) collection_str
Returns the value of attribute collection_str
11 12 13 |
# File 'lib/hip3/holding.rb', line 11 def collection_str @collection_str end |
- (Object) copy_str
Returns the value of attribute copy_str
11 12 13 |
# File 'lib/hip3/holding.rb', line 11 def copy_str @copy_str end |
- (Object) coverage_str
Returns the value of attribute coverage_str
11 12 13 |
# File 'lib/hip3/holding.rb', line 11 def coverage_str @coverage_str end |
- (Object) id
Returns the value of attribute id
11 12 13 |
# File 'lib/hip3/holding.rb', line 11 def id @id end |
- (Object) location_str
Returns the value of attribute location_str
11 12 13 |
# File 'lib/hip3/holding.rb', line 11 def location_str @location_str end |
- (Object) notes
Returns the value of attribute notes
11 12 13 |
# File 'lib/hip3/holding.rb', line 11 def notes @notes end |
- (Object) status_str
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
- (Object) coverage_str_to_a
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 |
- (Boolean) dummy?
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.
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 |
- (Object) textValue(el)
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 |