Sha256: 01f8a9efa660ac3c32cb8375f010bdc0a1b088b373d2f3c810d8135be090f16b

Contents?: true

Size: 357 Bytes

Versions: 6

Compression:

Stored size: 357 Bytes

Contents

# frozen_string_literal: true

# RuleReference interface as an object
module OpenscapParser
  class RuleReference < XmlNode
    def href
      @href ||= @parsed_xml && @parsed_xml['href']
    end

    def label
      @label ||= @parsed_xml && @parsed_xml.text
    end

    def to_h
      {
        href: href,
        label: label
      }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
openscap_parser-1.7.0 lib/openscap_parser/rule_reference.rb
openscap_parser-1.6.0 lib/openscap_parser/rule_reference.rb
openscap_parser-1.5.1 lib/openscap_parser/rule_reference.rb
openscap_parser-1.5.0 lib/openscap_parser/rule_reference.rb
openscap_parser-1.4.0 lib/openscap_parser/rule_reference.rb
openscap_parser-1.3.1 lib/openscap_parser/rule_reference.rb