Class: Ddr::FindingAid
- Inherits:
-
Object
- Object
- Ddr::FindingAid
- Defined in:
- app/models/ddr/finding_aid.rb
Instance Attribute Summary collapse
-
#ead_id ⇒ Object
readonly
Returns the value of attribute ead_id.
Instance Method Summary collapse
- #abstract ⇒ Object
- #collection_date_span ⇒ Object
- #collection_number ⇒ Object
- #collection_title ⇒ Object
- #extent ⇒ Object
-
#initialize(ead_id) ⇒ FindingAid
constructor
A new instance of FindingAid.
- #repository ⇒ Object
- #title ⇒ Object
-
#url ⇒ Object
TODO: use permalinks in the future when all finding aids have ARKs.
Constructor Details
#initialize(ead_id) ⇒ FindingAid
Returns a new instance of FindingAid.
5 6 7 |
# File 'app/models/ddr/finding_aid.rb', line 5 def initialize(ead_id) @ead_id = ead_id end |
Instance Attribute Details
#ead_id ⇒ Object (readonly)
Returns the value of attribute ead_id.
3 4 5 |
# File 'app/models/ddr/finding_aid.rb', line 3 def ead_id @ead_id end |
Instance Method Details
#abstract ⇒ Object
38 39 40 41 |
# File 'app/models/ddr/finding_aid.rb', line 38 def abstract first_abstract = doc.fetch('abstract_tesim',[])&.first ActionController::Base.helpers.(first_abstract) end |
#collection_date_span ⇒ Object
22 23 24 |
# File 'app/models/ddr/finding_aid.rb', line 22 def collection_date_span doc.fetch('normalized_date_ssm',[])&.first end |
#collection_number ⇒ Object
26 27 28 |
# File 'app/models/ddr/finding_aid.rb', line 26 def collection_number doc.fetch('unitid_ssm',[])&.first end |
#collection_title ⇒ Object
30 31 32 |
# File 'app/models/ddr/finding_aid.rb', line 30 def collection_title doc.fetch('title_ssm',[])&.first end |
#extent ⇒ Object
34 35 36 |
# File 'app/models/ddr/finding_aid.rb', line 34 def extent doc.fetch('extent_ssm',[]).join("; ") end |
#repository ⇒ Object
18 19 20 |
# File 'app/models/ddr/finding_aid.rb', line 18 def repository doc.fetch('repository_ssm',[])&.first end |
#title ⇒ Object
14 15 16 |
# File 'app/models/ddr/finding_aid.rb', line 14 def title doc.fetch('normalized_title_ssm',[])&.first end |
#url ⇒ Object
TODO: use permalinks in the future when all finding aids have ARKs
10 11 12 |
# File 'app/models/ddr/finding_aid.rb', line 10 def url [Ddr.finding_aid_base_url, '/catalog/', ead_id].join end |