Class: NewspaperPage
- Inherits:
-
ActiveFedora::Base
- Object
- ActiveFedora::Base
- NewspaperPage
- Includes:
- Hyrax::BasicMetadata, Hyrax::WorkBehavior, NewspaperWorks::ScannedMediaMetadata
- Defined in:
- app/models/newspaper_page.rb
Overview
Newspaper Page
Instance Method Summary collapse
- #articles ⇒ Object
- #container ⇒ Object
- #issue ⇒ Object
-
#publication ⇒ Object
get publication (transitive).
Instance Method Details
#articles ⇒ Object
57 58 59 |
# File 'app/models/newspaper_page.rb', line 57 def articles member_of.select { |v| v.instance_of?(NewspaperArticle) } end |
#container ⇒ Object
66 67 68 69 |
# File 'app/models/newspaper_page.rb', line 66 def container result = member_of.select { |v| v.instance_of?(NewspaperContainer) } result[0] unless result.empty? end |
#issue ⇒ Object
61 62 63 64 |
# File 'app/models/newspaper_page.rb', line 61 def issue result = member_of.select { |v| v.instance_of?(NewspaperIssue) } result[0] unless result.empty? end |
#publication ⇒ Object
get publication (transitive)
48 49 50 51 52 53 54 55 |
# File 'app/models/newspaper_page.rb', line 48 def publication # try transitive relation via issue first: issue = self.issue return issue.publication unless issue.nil? # fallback to trying to see if there is an issue-less container with title: container = self.container return container.publication unless container.nil? end |