Class: Puree::XMLExtractor::Thesis
- Inherits:
-
ResearchOutput
- Object
- Base
- Resource
- ResearchOutput
- Puree::XMLExtractor::Thesis
- Includes:
- DoiMixin, PagesMixin, PublisherMixin
- 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::ExternalOrganisationHeader?
-
#initialize(xml) ⇒ Thesis
constructor
A new instance of Thesis.
- #qualification ⇒ String?
- #sponsors ⇒ Array<Puree::Model::ExternalOrganisationHeader>
Methods included from PublisherMixin
Methods included from PagesMixin
Methods included from DoiMixin
Methods inherited from ResearchOutput
#bibliographical_note, #category, #doi, #dois, #files, #keywords, #language, #links, #open_access_permission, #persons_external, #persons_internal, #persons_other, #publication_statuses, #scopus_citations_count, #scopus_id, #scopus_metrics, #subtitle, #title, #translated_subtitle, #translated_title
Methods included from TypeMixin
Methods included from WorkflowMixin
Methods included from ResearchOutputMixin
Methods included from ProjectMixin
Methods included from OwnerMixin
Methods included from OrganisationalUnitMixin
Methods included from AbstractMixin
Methods inherited from Resource
#created_at, #created_by, #id, #model, #modified_at, #modified_by, #previous_uuids, #uuid
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.
11 12 13 14 |
# File 'lib/puree/xml_extractor/thesis.rb', line 11 def initialize(xml) super setup_model :thesis end |
Instance Method Details
#award_date ⇒ Time?
17 18 19 20 |
# File 'lib/puree/xml_extractor/thesis.rb', line 17 def award_date xpath_result = xpath_query_for_single_value('/awardedDate') Time.parse xpath_result if xpath_result end |
#awarding_institution ⇒ Puree::Model::ExternalOrganisationHeader?
23 24 25 26 |
# File 'lib/puree/xml_extractor/thesis.rb', line 23 def awarding_institution xpath_result = xpath_query '/awardingInstitutions/awardingInstitution/externalOrganisationalUnit' Puree::XMLExtractor::Shared.external_organisation_header xpath_result if xpath_result end |
#qualification ⇒ String?
29 30 31 |
# File 'lib/puree/xml_extractor/thesis.rb', line 29 def qualification xpath_query_for_single_value('/qualification/term/text') end |
#sponsors ⇒ Array<Puree::Model::ExternalOrganisationHeader>
34 35 36 37 |
# File 'lib/puree/xml_extractor/thesis.rb', line 34 def sponsors xpath_result = xpath_query '/sponsors/sponsor' Puree::XMLExtractor::Shared.external_organisation_multi_header xpath_result if xpath_result end |