Module: Puree::XMLExtractor::ResearchOutputMixin
- Included in:
- Dataset, ResearchOutput
- Defined in:
- lib/puree/xml_extractor/mixins/research_output_mixin.rb
Overview
Research output extractor mixin.
Instance Method Summary collapse
-
#research_outputs ⇒ Array<Puree::Model::RelatedContentHeader>
Related research outputs.
Instance Method Details
#research_outputs ⇒ Array<Puree::Model::RelatedContentHeader>
Related research outputs
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/puree/xml_extractor/mixins/research_output_mixin.rb', line 11 def research_outputs xpath_result = xpath_query '/relatedResearchOutputs/relatedResearchOutput' data_arr = [] xpath_result.each { |i| = Puree::Model::RelatedContentHeader.new .uuid = i.attr('uuid').strip xpath_result_name = i.xpath('names/name') .title = xpath_result_name.first.text.strip unless xpath_result_name.empty? xpath_result_type = i.xpath('types/type') .type = xpath_result_type.first.text.strip unless xpath_result_type.empty? data_arr << } data_arr.uniq { |d| d.uuid } end |