Module: Puree::XMLExtractor::ProjectMixin
- Included in:
- ResearchOutput
- Defined in:
- lib/puree/xml_extractor/mixins/project_mixin.rb
Overview
Project extractor mixin.
Instance Method Summary collapse
Instance Method Details
#projects ⇒ Array<Puree::Model::RelatedContentHeader>
Projects
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/puree/xml_extractor/mixins/project_mixin.rb', line 11 def projects xpath_result = xpath_query '/relatedProjects/relatedProject' data_arr = [] xpath_result.each { |i| = Puree::Model::RelatedContentHeader.new .type = i.xpath('type').text.strip .title = i.xpath('name').text.strip .uuid = i.attr('uuid').strip data_arr << } data_arr.uniq { |d| d.uuid } end |