Class: Nexpose::Organization
- Inherits:
-
Object
- Object
- Nexpose::Organization
- Defined in:
- lib/nexpose/common.rb
Overview
Organization configuration, as used in Site and Silo.
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.
216 217 218 |
# File 'lib/nexpose/common.rb', line 216 def initialize(&block) instance_eval(&block) if block_given? end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
210 211 212 |
# File 'lib/nexpose/common.rb', line 210 def address @address end |
#city ⇒ Object
Returns the value of attribute city.
212 213 214 |
# File 'lib/nexpose/common.rb', line 212 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
214 215 216 |
# File 'lib/nexpose/common.rb', line 214 def country @country end |
#email ⇒ Object
Returns the value of attribute email.
208 209 210 |
# File 'lib/nexpose/common.rb', line 208 def email @email end |
#job_title ⇒ Object
Returns the value of attribute job_title.
207 208 209 |
# File 'lib/nexpose/common.rb', line 207 def job_title @job_title end |
#name ⇒ Object
Returns the value of attribute name.
204 205 206 |
# File 'lib/nexpose/common.rb', line 204 def name @name end |
#primary_contact ⇒ Object
Returns the value of attribute primary_contact.
206 207 208 |
# File 'lib/nexpose/common.rb', line 206 def primary_contact @primary_contact end |
#state ⇒ Object
Returns the value of attribute state.
211 212 213 |
# File 'lib/nexpose/common.rb', line 211 def state @state end |
#telephone ⇒ Object
Returns the value of attribute telephone.
209 210 211 |
# File 'lib/nexpose/common.rb', line 209 def telephone @telephone end |
#url ⇒ Object
Returns the value of attribute url.
205 206 207 |
# File 'lib/nexpose/common.rb', line 205 def url @url end |
#zip ⇒ Object
Returns the value of attribute zip.
213 214 215 |
# File 'lib/nexpose/common.rb', line 213 def zip @zip end |
Class Method Details
.parse(xml) ⇒ Object
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/nexpose/common.rb', line 220 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
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/nexpose/common.rb', line 236 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 |