Skip to content

Commit

Permalink
feat(RefineValues): RHICOMPL-3460 parse refine-values for Profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
marleystipich2 authored and skateman committed Dec 12, 2022
1 parent 935ce21 commit f8563f2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/openscap_parser/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,17 @@ def selected_entity_ids
@parsed_xml.xpath("select[@selected='true']/@idref").map(&:text)
end

def refined_values
@refined_values ||= @parsed_xml.xpath("refine-value").each_with_object({}) do |element, rv|
rv[element.at_xpath('@idref').text] = element.at_xpath('@selector').text
end
end

def to_h
{ :id => id, :title => title, :description => description }
{ :id => id,
:title => title,
:description => description,
:refined_values => refined_values }
end
end
end

0 comments on commit f8563f2

Please sign in to comment.