class Oval::Definition
Public Instance Methods
description()
click to toggle source
# File lib/oval/definition.rb, line 23 def description xml = @parsed_xml.at_xpath("./metadata/description") @description ||= xml && xml.text end
id()
click to toggle source
# File lib/oval/definition.rb, line 6 def id @id ||= @parsed_xml['id'] end
klass()
click to toggle source
# File lib/oval/definition.rb, line 14 def klass @klass ||= @parsed_xml['class'] end
reference_nodes()
click to toggle source
# File lib/oval/definition.rb, line 28 def reference_nodes @reference_nodes ||= @parsed_xml.xpath("./metadata/reference") end
references()
click to toggle source
# File lib/oval/definition.rb, line 32 def references @references ||= reference_nodes.map { |node| Reference.new parsed_xml: node } end
title()
click to toggle source
# File lib/oval/definition.rb, line 18 def title xml = @parsed_xml.at_xpath("./metadata/title") @title ||= xml && xml.text end
to_h()
click to toggle source
# File lib/oval/definition.rb, line 36 def to_h { :id => id, :version => version, :klass => klass, :title => title, :description => description, :references => references.map(&:to_h) } end
version()
click to toggle source
# File lib/oval/definition.rb, line 10 def version @version ||= @parsed_xml['version'] end