Class: Puree::XMLExtractor::Project
Overview
Instance Method Summary
collapse
#external_organisations
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.
11
12
13
14
|
# File 'lib/puree/xml_extractor/project.rb', line 11
def initialize(xml:)
super
@resource_type = :project
end
|
Instance Method Details
#acronym ⇒ String?
17
18
19
|
# File 'lib/puree/xml_extractor/project.rb', line 17
def acronym
xpath_query_for_single_value '/acronym'
end
|
#description ⇒ String?
22
23
24
|
# File 'lib/puree/xml_extractor/project.rb', line 22
def description
xpath_query_for_single_value '/description/localizedString'
end
|
#funded? ⇒ Boolean
27
28
29
30
31
|
# File 'lib/puree/xml_extractor/project.rb', line 27
def funded?
xpath_result = xpath_query_for_single_value '/type'
return false if xpath_result.downcase.include? 'nonfunded'
true
end
|
34
35
36
37
|
# File 'lib/puree/xml_extractor/project.rb', line 34
def organisations
xpath_result = xpath_query '/organisations/association/organisation'
Puree::XMLExtractor::Shared. xpath_result
end
|
40
41
42
43
|
# File 'lib/puree/xml_extractor/project.rb', line 40
def owner
xpath_result = xpath_query '/owner'
Puree::XMLExtractor::Shared. xpath_result
end
|
51
52
53
|
# File 'lib/puree/xml_extractor/project.rb', line 51
def persons_external
persons 'external'
end
|
46
47
48
|
# File 'lib/puree/xml_extractor/project.rb', line 46
def persons_internal
persons 'internal'
end
|
56
57
58
|
# File 'lib/puree/xml_extractor/project.rb', line 56
def persons_other
persons 'other'
end
|
#status ⇒ String?
61
62
63
|
# File 'lib/puree/xml_extractor/project.rb', line 61
def status
xpath_query_for_single_value '/status/term/localizedString'
end
|
71
72
73
|
# File 'lib/puree/xml_extractor/project.rb', line 71
def temporal_actual
temporal_range '/startFinishDate/startDate', '/startFinishDate/endDate'
end
|
66
67
68
|
# File 'lib/puree/xml_extractor/project.rb', line 66
def temporal_expected
temporal_range '/expectedStartDate', '/expectedEndDate'
end
|
#title ⇒ String?
76
77
78
|
# File 'lib/puree/xml_extractor/project.rb', line 76
def title
xpath_query_for_single_value '/title/localizedString'
end
|
#type ⇒ String?
81
82
83
|
# File 'lib/puree/xml_extractor/project.rb', line 81
def type
xpath_query_for_single_value '/typeClassification/term/localizedString'
end
|
#url ⇒ String?
86
87
88
|
# File 'lib/puree/xml_extractor/project.rb', line 86
def url
xpath_query_for_single_value '/projectURL'
end
|