Class: Puree::XMLExtractor::Thesis

Inherits:
ResearchOutput show all
Includes:
DoiMixin, PagesMixin, PublisherMixin
Defined in:
lib/puree/xml_extractor/thesis.rb

Overview

Thesis XML extractor.

Direct Known Subclasses

DoctoralThesis, MastersThesis

Instance Method Summary collapse

Methods included from PublisherMixin

#publisher

Methods included from PagesMixin

#pages

Methods included from DoiMixin

#doi

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

#type

Methods included from WorkflowMixin

#workflow

Methods included from ResearchOutputMixin

#research_outputs

Methods included from ProjectMixin

#projects

Methods included from OwnerMixin

#owner

Methods included from OrganisationalUnitMixin

#organisational_units

Methods included from AbstractMixin

#description

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_dateTime?

Returns:

  • (Time, nil)


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_institutionPuree::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

#qualificationString?

Returns:

  • (String, nil)


29
30
31
# File 'lib/puree/xml_extractor/thesis.rb', line 29

def qualification
  xpath_query_for_single_value('/qualification/term/text')
end

#sponsorsArray<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