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.



678
679
680
# File 'lib/nexpose/site.rb', line 678

def initialize(hostname)
  @host = hostname
end

Instance Attribute Details

#hostObject

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

Returns:

  • (Boolean)


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

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

#hashObject



692
693
694
# File 'lib/nexpose/site.rb', line 692

def hash
  to_xml.hash
end

#to_xmlObject



702
703
704
# File 'lib/nexpose/site.rb', line 702

def to_xml
  to_xml_elem.to_s
end

#to_xml_elemObject



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