class Puree::XMLExtractor::Thesis
Thesis
XML extractor.
Public Class Methods
new(xml)
click to toggle source
Calls superclass method
Puree::XMLExtractor::ResearchOutput::new
# File lib/puree/xml_extractor/thesis.rb, line 11 def initialize(xml) super setup_model :thesis end
Public Instance Methods
award_date()
click to toggle source
@return [Time, nil]
# 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()
click to toggle source
@return [Puree::Model::ExternalOrganisationHeader, nil]
# 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()
click to toggle source
@return [String, nil]
# File lib/puree/xml_extractor/thesis.rb, line 29 def qualification xpath_query_for_single_value('/qualification/term/text') end
sponsors()
click to toggle source
@return [Array<Puree::Model::ExternalOrganisationHeader>]
# 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
Private Instance Methods
combine_metadata()
click to toggle source
Calls superclass method
Puree::XMLExtractor::ResearchOutput#combine_metadata
# File lib/puree/xml_extractor/thesis.rb, line 45 def combine_metadata super @model.award_date = award_date @model.awarding_institution = awarding_institution @model.doi = doi @model.pages = pages @model.publisher = publisher @model.qualification = qualification @model.sponsors = sponsors @model end
xpath_root()
click to toggle source
# File lib/puree/xml_extractor/thesis.rb, line 41 def xpath_root '/thesis' end