Class: Puree::XMLExtractor::Project

Inherits:
Resource show all
Defined in:
lib/puree/xml_extractor/project.rb

Overview

Project XML extractor.

Instance Method Summary collapse

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

Returns a new instance of Project.



9
10
11
12
# File 'lib/puree/xml_extractor/project.rb', line 9

def initialize(xml:)
  super
  @resource_type = :project
end

Instance Method Details

#acronymString?

Returns:

  • (String, nil)


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

def acronym
  xpath_query_for_single_value '/acronym'
end

#descriptionString?

Returns:

  • (String, nil)


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

def description
  xpath_query_for_single_value '/description/localizedString'
end

#organisationsArray<Puree::Model::OrganisationHeader>



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

def organisations
  xpath_result = xpath_query '/organisations/association/organisation'
  Puree::XMLExtractor::Shared.organisation_multi_header xpath_result
end

#ownerPuree::Model::OrganisationHeader?



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'
end

#persons_internalArray<Puree::Model::EndeavourPerson>

Returns:



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

def persons_internal
  persons 'internal'
end

#persons_otherArray<Puree::Model::EndeavourPerson>

Returns:



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

def persons_other
  persons 'other'
end

#statusString?

Returns:

  • (String, nil)


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

def status
  xpath_query_for_single_value '/status/term/localizedString'
end

#temporal_actualPuree::Model::TemporalRange?

Returns:



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

def temporal_actual
  temporal_range '/startFinishDate/startDate', '/startFinishDate/endDate'
end

#temporal_expectedPuree::Model::TemporalRange?

Returns:



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

def temporal_expected
  temporal_range '/expectedStartDate', '/expectedEndDate'
end

#titleString?

Returns:

  • (String, nil)


67
68
69
# File 'lib/puree/xml_extractor/project.rb', line 67

def title
  xpath_query_for_single_value '/title/localizedString'
end

#typeString?

Returns:

  • (String, nil)


72
73
74
# File 'lib/puree/xml_extractor/project.rb', line 72

def type
  xpath_query_for_single_value '/typeClassification/term/localizedString'
end

#urlString?

Returns:

  • (String, nil)


77
78
79
# File 'lib/puree/xml_extractor/project.rb', line 77

def url
  xpath_query_for_single_value '/projectURL'
end