Class: Nexpose::HostName
- Inherits:
-
Object
- Object
- Nexpose::HostName
- Includes:
- Comparable
- Defined in:
- lib/nexpose/site.rb
Overview
Object that represents a hostname to be added to a site.
Instance Attribute Summary collapse
-
#host ⇒ Object
Named host (usually DNS or Netbios name).
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(hostname) ⇒ HostName
constructor
A new instance of HostName.
- #to_xml ⇒ Object
- #to_xml_elem ⇒ Object
Constructor Details
#initialize(hostname) ⇒ HostName
Returns a new instance of HostName.
383 384 385 |
# File 'lib/nexpose/site.rb', line 383 def initialize(hostname) @host = hostname end |
Instance Attribute Details
#host ⇒ Object
Named host (usually DNS or Netbios name).
381 382 383 |
# File 'lib/nexpose/site.rb', line 381 def host @host end |
Instance Method Details
#<=>(other) ⇒ Object
389 390 391 |
# File 'lib/nexpose/site.rb', line 389 def <=>(other) to_xml <=> other.to_xml end |
#eql?(other) ⇒ Boolean
393 394 395 |
# File 'lib/nexpose/site.rb', line 393 def eql?(other) to_xml == other.to_xml end |
#hash ⇒ Object
397 398 399 |
# File 'lib/nexpose/site.rb', line 397 def hash to_xml.hash end |
#to_xml ⇒ Object
407 408 409 |
# File 'lib/nexpose/site.rb', line 407 def to_xml to_xml_elem.to_s end |
#to_xml_elem ⇒ Object
401 402 403 404 405 |
# File 'lib/nexpose/site.rb', line 401 def to_xml_elem xml = REXML::Element.new('host') xml.text = @host xml end |