Class: Puree::XMLExtractor::Thesis
- Inherits:
-
Publication
- Object
- Base
- Resource
- Publication
- Puree::XMLExtractor::Thesis
- Includes:
- DoiMixin, PagesMixin
- Defined in:
- lib/puree/xml_extractor/thesis.rb
Overview
Thesis XML extractor.
Direct Known Subclasses
Instance Method Summary collapse
- #award_date ⇒ Time?
- #awarding_institution ⇒ Puree::Model::OrganisationHeader?
-
#initialize(xml:) ⇒ Thesis
constructor
A new instance of Thesis.
- #qualification ⇒ String?
- #sponsors ⇒ Array<String>
Methods included from PagesMixin
Methods included from DoiMixin
Methods inherited from Publication
#bibliographical_note, #category, #description, #dois, #files, #keywords, #language, #links, #organisations, #owner, #persons_external, #persons_internal, #persons_other, #publication_place, #publisher, #scopus_id, #statuses, #subtitle, #title, #translated_subtitle, #translated_title, #type
Methods included from WorkflowStateMixin
Methods included from ExternalOrganisationsMixin
Methods included from AssociatedMixin
Methods inherited from Resource
#created, #get_data?, #locale, #modified, #uuid, #xpath_query
Methods inherited from Base
#xpath_query_for_multi_value, #xpath_query_for_single_value
Constructor Details
#initialize(xml:) ⇒ Thesis
Returns a new instance of Thesis.
10 11 12 |
# File 'lib/puree/xml_extractor/thesis.rb', line 10 def initialize(xml:) super end |
Instance Method Details
#award_date ⇒ Time?
15 16 17 18 |
# File 'lib/puree/xml_extractor/thesis.rb', line 15 def award_date xpath_result = xpath_query_for_single_value('/awardDate') Time.parse xpath_result if xpath_result end |
#awarding_institution ⇒ Puree::Model::OrganisationHeader?
21 22 23 24 |
# File 'lib/puree/xml_extractor/thesis.rb', line 21 def awarding_institution xpath_result = xpath_query '/awardingInstitution/internalExternalOrganisationAssociation/organisation' Puree::XMLExtractor::Shared.organisation_header xpath_result end |
#qualification ⇒ String?
27 28 29 30 31 32 33 34 35 |
# File 'lib/puree/xml_extractor/thesis.rb', line 27 def qualification types = { '/dk/atira/pure/thesis/qualification/mphil' => 'MPhil', '/dk/atira/pure/thesis/qualification/phd' => 'PhD', '/dk/atira/pure/thesis/qualification/masters_by_research' => 'Masters by Research' } xpath_result = xpath_query_for_single_value '/qualification/uri' types[xpath_result] end |
#sponsors ⇒ Array<String>
38 39 40 |
# File 'lib/puree/xml_extractor/thesis.rb', line 38 def sponsors xpath_query_for_multi_value '/sponsors/externalOrganisation/name' end |