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.



690
691
692
# File 'lib/nexpose/site.rb', line 690

def initialize(hostname)
  @host = hostname
end

Instance Attribute Details

#hostObject

Named host (usually DNS or Netbios name).



688
689
690
# File 'lib/nexpose/site.rb', line 688

def host
  @host
end

Instance Method Details

#<=>(other) ⇒ Object



696
697
698
# File 'lib/nexpose/site.rb', line 696

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


700
701
702
# File 'lib/nexpose/site.rb', line 700

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

#hashObject



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

def hash
  to_xml.hash
end

#to_xmlObject



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

def to_xml
  to_xml_elem.to_s
end

#to_xml_elemObject



708
709
710
711
712
# File 'lib/nexpose/site.rb', line 708

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