Class: Nexpose::Organization
- Inherits:
-
Object
- Object
- Nexpose::Organization
- Defined in:
- lib/nexpose/common.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#email ⇒ Object
Returns the value of attribute email.
-
#job_title ⇒ Object
Returns the value of attribute job_title.
-
#name ⇒ Object
Returns the value of attribute name.
-
#primary_contact ⇒ Object
Returns the value of attribute primary_contact.
-
#state ⇒ Object
Returns the value of attribute state.
-
#telephone ⇒ Object
Returns the value of attribute telephone.
-
#url ⇒ Object
Returns the value of attribute url.
-
#zip ⇒ Object
Returns the value of attribute zip.
Class Method Summary collapse
Instance Method Summary collapse
- #as_xml ⇒ Object
-
#initialize(&block) ⇒ Organization
constructor
A new instance of Organization.
Constructor Details
#initialize(&block) ⇒ Organization
Returns a new instance of Organization.
180 181 182 |
# File 'lib/nexpose/common.rb', line 180 def initialize(&block) instance_eval &block if block_given? end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
174 175 176 |
# File 'lib/nexpose/common.rb', line 174 def address @address end |
#city ⇒ Object
Returns the value of attribute city.
176 177 178 |
# File 'lib/nexpose/common.rb', line 176 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
178 179 180 |
# File 'lib/nexpose/common.rb', line 178 def country @country end |
#email ⇒ Object
Returns the value of attribute email.
172 173 174 |
# File 'lib/nexpose/common.rb', line 172 def email @email end |
#job_title ⇒ Object
Returns the value of attribute job_title.
171 172 173 |
# File 'lib/nexpose/common.rb', line 171 def job_title @job_title end |
#name ⇒ Object
Returns the value of attribute name.
168 169 170 |
# File 'lib/nexpose/common.rb', line 168 def name @name end |
#primary_contact ⇒ Object
Returns the value of attribute primary_contact.
170 171 172 |
# File 'lib/nexpose/common.rb', line 170 def primary_contact @primary_contact end |
#state ⇒ Object
Returns the value of attribute state.
175 176 177 |
# File 'lib/nexpose/common.rb', line 175 def state @state end |
#telephone ⇒ Object
Returns the value of attribute telephone.
173 174 175 |
# File 'lib/nexpose/common.rb', line 173 def telephone @telephone end |
#url ⇒ Object
Returns the value of attribute url.
169 170 171 |
# File 'lib/nexpose/common.rb', line 169 def url @url end |
#zip ⇒ Object
Returns the value of attribute zip.
177 178 179 |
# File 'lib/nexpose/common.rb', line 177 def zip @zip end |
Class Method Details
.parse(xml) ⇒ Object
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/nexpose/common.rb', line 184 def self.parse(xml) new do |org| org.name = xml.attributes['name'] org.url = xml.attributes['url'] org.primary_contact = xml.attributes['primaryContact'] org.job_title = xml.attributes['jobTitle'] org.email = xml.attributes['email'] org.telephone = xml.attributes['telephone'] org.address = xml.attributes['businessAddress'] org.state = xml.attributes['state'] org.city = xml.attributes['city'] org.zip = xml.attributes['zip'] org.country = xml.attributes['country'] end end |
Instance Method Details
#as_xml ⇒ Object
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/nexpose/common.rb', line 200 def as_xml xml = REXML::Element.new('Organization') xml.add_attribute('name', @name) xml.add_attribute('url', @url) xml.add_attribute('primaryContact', @primary_contact) xml.add_attribute('jobTitle', @job_title) xml.add_attribute('email', @email) xml.add_attribute('telephone', @telephone) xml.add_attribute('businessAddress', @address) xml.add_attribute('state', @state) xml.add_attribute('city', @city) xml.add_attribute('zip', @zip) xml.add_attribute('country', @country) xml end |