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.
158 159 160 |
# File 'lib/nexpose/silo.rb', line 158 def initialize(&block) instance_eval(&block) if block_given? end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
153 154 155 |
# File 'lib/nexpose/silo.rb', line 153 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
156 157 158 |
# File 'lib/nexpose/silo.rb', line 156 def country @country end |
#line1 ⇒ Object
Returns the value of attribute line1.
151 152 153 |
# File 'lib/nexpose/silo.rb', line 151 def line1 @line1 end |
#line2 ⇒ Object
Returns the value of attribute line2.
152 153 154 |
# File 'lib/nexpose/silo.rb', line 152 def line2 @line2 end |
#state ⇒ Object
Returns the value of attribute state.
154 155 156 |
# File 'lib/nexpose/silo.rb', line 154 def state @state end |
#zip ⇒ Object
Returns the value of attribute zip.
155 156 157 |
# File 'lib/nexpose/silo.rb', line 155 def zip @zip end |
Class Method Details
.parse(xml) ⇒ Object
162 163 164 165 166 167 168 169 170 171 |
# 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 |
Instance Method Details
#as_xml ⇒ Object
173 174 175 176 177 |
# 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 |