Class: Nexpose::Silo::Address
- Inherits:
-
Object
- Object
- Nexpose::Silo::Address
- Defined in:
- lib/nexpose/silo.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#line1 ⇒ Object
Returns the value of attribute line1.
-
#line2 ⇒ Object
Returns the value of attribute line2.
-
#state ⇒ Object
Returns the value of attribute state.
-
#zip ⇒ Object
Returns the value of attribute zip.
Class Method Summary collapse
Instance Method Summary collapse
- #as_xml ⇒ Object
-
#initialize(&block) ⇒ Address
constructor
A new instance of Address.
Constructor Details
#initialize(&block) ⇒ Address
Returns a new instance of Address.
160 161 162 |
# File 'lib/nexpose/silo.rb', line 160 def initialize(&block) instance_eval &block if block_given? end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
154 155 156 |
# File 'lib/nexpose/silo.rb', line 154 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
157 158 159 |
# File 'lib/nexpose/silo.rb', line 157 def country @country end |
#line1 ⇒ Object
Returns the value of attribute line1.
152 153 154 |
# File 'lib/nexpose/silo.rb', line 152 def line1 @line1 end |
#line2 ⇒ Object
Returns the value of attribute line2.
153 154 155 |
# File 'lib/nexpose/silo.rb', line 153 def line2 @line2 end |
#state ⇒ Object
Returns the value of attribute state.
155 156 157 |
# File 'lib/nexpose/silo.rb', line 155 def state @state end |
#zip ⇒ Object
Returns the value of attribute zip.
156 157 158 |
# File 'lib/nexpose/silo.rb', line 156 def zip @zip end |
Class Method Details
.parse(xml) ⇒ Object
164 165 166 167 168 169 170 171 172 173 |
# File 'lib/nexpose/silo.rb', line 164 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 |
Instance Method Details
#as_xml ⇒ Object
175 176 177 178 179 |
# File 'lib/nexpose/silo.rb', line 175 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 |