Class: Puree::XMLExtractor::Project

Inherits:
Resource show all
Includes:
ExternalOrganisationMixin, IdentifierMixin, OrganisationalUnitMixin, PersonMixin, TitleMixin, TypeMixin
Defined in:
lib/puree/xml_extractor/project.rb

Overview

Project XML extractor.

Instance Method Summary collapse

Methods included from TypeMixin

#type

Methods included from TitleMixin

#title

Methods included from OrganisationalUnitMixin

#organisational_units

Methods included from IdentifierMixin

#identifiers

Methods included from ExternalOrganisationMixin

#external_organisations

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) ⇒ Project

Returns a new instance of Project.



15
16
17
18
# File 'lib/puree/xml_extractor/project.rb', line 15

def initialize(xml)
  super
  setup_model :project
end

Instance Method Details

#acronymString?

Returns:

  • (String, nil)


21
22
23
# File 'lib/puree/xml_extractor/project.rb', line 21

def acronym
  xpath_query_for_single_value '/acronym'
end

#descriptionString?

Returns:

  • (String, nil)


26
27
28
# File 'lib/puree/xml_extractor/project.rb', line 26

def description
  xpath_query_for_single_value '/descriptions/description'
end

#ownerPuree::Model::OrganisationalUnitHeader?



31
32
33
34
# File 'lib/puree/xml_extractor/project.rb', line 31

def owner
  xpath_result = xpath_query '/owner'
  Puree::XMLExtractor::Shared.organisation_header xpath_result
end

#persons_externalArray<Puree::Model::EndeavourPerson>

Returns:



42
43
44
# File 'lib/puree/xml_extractor/project.rb', line 42

def persons_external
  persons 'external', '/participants/participant'
end

#persons_internalArray<Puree::Model::EndeavourPerson>

Returns:



37
38
39
# File 'lib/puree/xml_extractor/project.rb', line 37

def persons_internal
  persons 'internal', '/participants/participant'
end

#persons_otherArray<Puree::Model::EndeavourPerson>

Returns:



47
48
49
# File 'lib/puree/xml_extractor/project.rb', line 47

def persons_other
  persons 'other', '/participants/participant'
end

#statusString?

Returns:

  • (String, nil)


52
53
54
# File 'lib/puree/xml_extractor/project.rb', line 52

def status
  xpath_query_for_single_value '/statuses/status'
end

#temporalPuree::Model::TemporalRange?

Returns:



57
58
59
# File 'lib/puree/xml_extractor/project.rb', line 57

def temporal
  temporal_range '/period/startDate', '/period/endDate'
end

#urlString?

Returns:

  • (String, nil)


62
63
64
# File 'lib/puree/xml_extractor/project.rb', line 62

def url
  xpath_query_for_single_value '/links/link/url'
end