class Nexpose::Silo::Address

Attributes

city[RW]
country[RW]
line1[RW]
line2[RW]
state[RW]
zip[RW]

Public Class Methods

new(&block) click to toggle source
# File lib/nexpose/silo.rb, line 158
def initialize(&block)
  instance_eval(&block) if block_given?
end
parse(xml) click to toggle source
# File lib/nexpose/silo.rb, line 162
def self.parse(xml)
  new do |address|
    address.line1   = xml.attributes['line1']
    address.line2   = xml.attributes['line2']
    address.city    = xml.attributes['city']
    address.state   = xml.attributes['state']
    address.zip     = xml.attributes['zip']
    address.country = xml.attributes['country']
  end
end

Public Instance Methods

as_xml() click to toggle source
# File lib/nexpose/silo.rb, line 173
def as_xml
  xml = REXML::Element.new('Address')
  xml.add_attributes({ 'city' => @city, 'country' => @country, 'line1' => @line1, 'line2' => @line2, 'state' => @state, 'zip' => @zip })
  xml
end