class Nexpose::TagSummary

Summary value object for tag information

Attributes

id[RW]

ID of tag

name[RW]

Name of tag

type[RW]

Public Class Methods

new(name, type, id) click to toggle source
# File lib/nexpose/tag.rb, line 125
def initialize(name, type, id)
  @name = name
  @type = type
  @id   = id
end
parse(json) click to toggle source
# File lib/nexpose/tag.rb, line 131
def self.parse(json)
  new(json['tag_name'], json['tag_type'], json['tag_id'])
end
parse_xml(xml) click to toggle source
# File lib/nexpose/tag.rb, line 135
def self.parse_xml(xml)
  new(xml.attributes['name'], xml.attributes['type'], xml.attributes['id'].to_i)
end

Public Instance Methods

as_xml() click to toggle source

XML representation of the tag summary as required by Site and AssetGroup

@return [ELEMENT] XML element

# File lib/nexpose/tag.rb, line 143
def as_xml
  xml = REXML::Element.new('Tag')
  xml.add_attribute('id', @id)
  xml.add_attribute('name', @name)
  xml.add_attribute('type', @type)
  xml
end