Class: Nexpose::HostName

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(hostname) ⇒ HostName

Returns a new instance of HostName.



707
708
709
# File 'lib/nexpose/site.rb', line 707

def initialize(hostname)
  @host = hostname
end

Instance Attribute Details

#hostObject

Named host (usually DNS or Netbios name).



705
706
707
# File 'lib/nexpose/site.rb', line 705

def host
  @host
end

Instance Method Details

#<=>(other) ⇒ Object



713
714
715
# File 'lib/nexpose/site.rb', line 713

def <=>(other)
  to_xml <=> other.to_xml
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


717
718
719
# File 'lib/nexpose/site.rb', line 717

def eql?(other)
  to_xml == other.to_xml
end

#hashObject



721
722
723
# File 'lib/nexpose/site.rb', line 721

def hash
  to_xml.hash
end

#to_xmlObject



731
732
733
# File 'lib/nexpose/site.rb', line 731

def to_xml
  to_xml_elem.to_s
end

#to_xml_elemObject



725
726
727
728
729
# File 'lib/nexpose/site.rb', line 725

def to_xml_elem
  xml = REXML::Element.new('host')
  xml.text = @host
  xml
end