Class: Nexpose::HostName
- Inherits:
-
Object
- Object
- Nexpose::HostName
- Includes:
- Comparable
- Defined in:
- lib/nexpose/site.rb
Overview
Description
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.
678 679 680 |
# File 'lib/nexpose/site.rb', line 678 def initialize(hostname) @host = hostname end |
Instance Attribute Details
#host ⇒ Object
Named host (usually DNS or Netbios name).
676 677 678 |
# File 'lib/nexpose/site.rb', line 676 def host @host end |
Instance Method Details
#<=>(other) ⇒ Object
684 685 686 |
# File 'lib/nexpose/site.rb', line 684 def <=>(other) to_xml <=> other.to_xml end |
#eql?(other) ⇒ Boolean
688 689 690 |
# File 'lib/nexpose/site.rb', line 688 def eql?(other) to_xml == other.to_xml end |
#hash ⇒ Object
692 693 694 |
# File 'lib/nexpose/site.rb', line 692 def hash to_xml.hash end |
#to_xml ⇒ Object
702 703 704 |
# File 'lib/nexpose/site.rb', line 702 def to_xml to_xml_elem.to_s end |
#to_xml_elem ⇒ Object
696 697 698 699 700 |
# File 'lib/nexpose/site.rb', line 696 def to_xml_elem xml = REXML::Element.new('host') xml.text = @host xml end |