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
- #as_xml ⇒ Object (also: #to_xml_elem)
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(hostname) ⇒ HostName
constructor
A new instance of HostName.
- #to_xml ⇒ Object
Constructor Details
#initialize(hostname) ⇒ HostName
Returns a new instance of HostName.
578 579 580 |
# File 'lib/nexpose/site.rb', line 578 def initialize(hostname) @host = hostname end |
Instance Attribute Details
#host ⇒ Object
Named host (usually DNS or Netbios name).
576 577 578 |
# File 'lib/nexpose/site.rb', line 576 def host @host end |
Instance Method Details
#<=>(other) ⇒ Object
584 585 586 |
# File 'lib/nexpose/site.rb', line 584 def <=>(other) to_xml <=> other.to_xml end |
#as_xml ⇒ Object Also known as: to_xml_elem
596 597 598 599 600 |
# File 'lib/nexpose/site.rb', line 596 def as_xml xml = REXML::Element.new('host') xml.text = @host xml end |
#eql?(other) ⇒ Boolean
588 589 590 |
# File 'lib/nexpose/site.rb', line 588 def eql?(other) to_xml == other.to_xml end |
#hash ⇒ Object
592 593 594 |
# File 'lib/nexpose/site.rb', line 592 def hash to_xml.hash end |
#to_xml ⇒ Object
603 604 605 |
# File 'lib/nexpose/site.rb', line 603 def to_xml to_xml_elem.to_s end |