Class: Hip3::Holding
- Inherits:
-
Object
- Object
- Hip3::Holding
- Defined in:
- app/models/hip3/holding.rb
Overview
we put it here anyway, it’ll just be nil for mono items.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#bib ⇒ Object
Holdings sometimes use the bib to lazy load more stuff.
-
#call_no ⇒ Object
Returns the value of attribute call_no.
-
#collection_str ⇒ Object
Returns the value of attribute collection_str.
-
#copy_str ⇒ Object
Returns the value of attribute copy_str.
-
#coverage_str ⇒ Object
Returns the value of attribute coverage_str.
-
#id ⇒ Object
Returns the value of attribute id.
-
#location_str ⇒ Object
Returns the value of attribute location_str.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#status_str ⇒ Object
Returns the value of attribute status_str.
Instance Method Summary collapse
-
#coverage_str_to_a ⇒ Object
Return an array of holding strings, possibly empty, possibly single-valued.
-
#dummy? ⇒ Boolean
Some items are dummy/placeholder items which don’t really represent an item, and shouldn’t be shown.
-
#textValue(el) ⇒ Object
If input is nil, returns nil, else returns input.inner_text.
Instance Attribute Details
#bib ⇒ Object
Holdings sometimes use the bib to lazy load more stuff.
13 14 15 |
# File 'app/models/hip3/holding.rb', line 13 def bib @bib end |
#call_no ⇒ Object
Returns the value of attribute call_no.
11 12 13 |
# File 'app/models/hip3/holding.rb', line 11 def call_no @call_no end |
#collection_str ⇒ Object
Returns the value of attribute collection_str.
11 12 13 |
# File 'app/models/hip3/holding.rb', line 11 def collection_str @collection_str end |
#copy_str ⇒ Object
Returns the value of attribute copy_str.
11 12 13 |
# File 'app/models/hip3/holding.rb', line 11 def copy_str @copy_str end |
#coverage_str ⇒ Object
Returns the value of attribute coverage_str.
11 12 13 |
# File 'app/models/hip3/holding.rb', line 11 def coverage_str @coverage_str end |
#id ⇒ Object
Returns the value of attribute id.
11 12 13 |
# File 'app/models/hip3/holding.rb', line 11 def id @id end |
#location_str ⇒ Object
Returns the value of attribute location_str.
11 12 13 |
# File 'app/models/hip3/holding.rb', line 11 def location_str @location_str end |
#notes ⇒ Object
Returns the value of attribute notes.
11 12 13 |
# File 'app/models/hip3/holding.rb', line 11 def notes @notes end |
#status_str ⇒ Object
Returns the value of attribute status_str.
11 12 13 |
# File 'app/models/hip3/holding.rb', line 11 def status_str @status_str end |
Instance Method Details
#coverage_str_to_a ⇒ Object
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 'app/models/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.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/models/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 'app/models/hip3/holding.rb', line 16 def textValue(el) return ( el == nil ? nil : el.inner_text) end |