class NipperParser::Information

Attributes

author[R]

Information parses the 'Information' part

@example Basic Usage

require 'nokogiri'
require 'pp'
config = Nokogiri::XML open(ARGV[0])
pp information.title
pp information.author
pp information.date
pp information.version
pp information.devices

@param config [Nokogiri::XML] parsed XML @attr_reader config [Nokogiri::XML] parsed XML object @attr_reader title [Sting] report title @attr_reader author [Sting] report author @attr_reader date [Sting] report generation date @attr_reader version [Sting] Nipper Studio version @attr_reader the tested devices

config[R]

Information parses the 'Information' part

@example Basic Usage

require 'nokogiri'
require 'pp'
config = Nokogiri::XML open(ARGV[0])
pp information.title
pp information.author
pp information.date
pp information.version
pp information.devices

@param config [Nokogiri::XML] parsed XML @attr_reader config [Nokogiri::XML] parsed XML object @attr_reader title [Sting] report title @attr_reader author [Sting] report author @attr_reader date [Sting] report generation date @attr_reader version [Sting] Nipper Studio version @attr_reader the tested devices

date[R]

Information parses the 'Information' part

@example Basic Usage

require 'nokogiri'
require 'pp'
config = Nokogiri::XML open(ARGV[0])
pp information.title
pp information.author
pp information.date
pp information.version
pp information.devices

@param config [Nokogiri::XML] parsed XML @attr_reader config [Nokogiri::XML] parsed XML object @attr_reader title [Sting] report title @attr_reader author [Sting] report author @attr_reader date [Sting] report generation date @attr_reader version [Sting] Nipper Studio version @attr_reader the tested devices

devices[R]

Information parses the 'Information' part

@example Basic Usage

require 'nokogiri'
require 'pp'
config = Nokogiri::XML open(ARGV[0])
pp information.title
pp information.author
pp information.date
pp information.version
pp information.devices

@param config [Nokogiri::XML] parsed XML @attr_reader config [Nokogiri::XML] parsed XML object @attr_reader title [Sting] report title @attr_reader author [Sting] report author @attr_reader date [Sting] report generation date @attr_reader version [Sting] Nipper Studio version @attr_reader the tested devices

title[R]

Information parses the 'Information' part

@example Basic Usage

require 'nokogiri'
require 'pp'
config = Nokogiri::XML open(ARGV[0])
pp information.title
pp information.author
pp information.date
pp information.version
pp information.devices

@param config [Nokogiri::XML] parsed XML @attr_reader config [Nokogiri::XML] parsed XML object @attr_reader title [Sting] report title @attr_reader author [Sting] report author @attr_reader date [Sting] report generation date @attr_reader version [Sting] Nipper Studio version @attr_reader the tested devices

version[R]

Information parses the 'Information' part

@example Basic Usage

require 'nokogiri'
require 'pp'
config = Nokogiri::XML open(ARGV[0])
pp information.title
pp information.author
pp information.date
pp information.version
pp information.devices

@param config [Nokogiri::XML] parsed XML @attr_reader config [Nokogiri::XML] parsed XML object @attr_reader title [Sting] report title @attr_reader author [Sting] report author @attr_reader date [Sting] report generation date @attr_reader version [Sting] Nipper Studio version @attr_reader the tested devices

Public Class Methods

new(config) click to toggle source

@config The configuration [File]

# File lib/nipper_parser/parsers/information.rb, line 27
def initialize(config)
  @config  = config.xpath('//information')[0]
  @title   = @config.elements[0].text
  @author  = @config.elements[1].text
  @date    = @config.elements[2].text
  @version = @config.elements[3].elements[3].text
  @devices = parse_devices
end

Public Instance Methods

parse_devices() click to toggle source

parse_devices parse first devices list of the report @return [Array<Hash{Symbol => String}>]

# File lib/nipper_parser/parsers/information.rb, line 38
def parse_devices
  @config.xpath('devices')[0].elements.map do |device|
    {
        name: device.attributes['name'].text,
        type: device.attributes['type'].text,
        os:   device.attributes['os'].text
    }
  end
end