Class: Nexpose::HostName

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/nexpose/site.rb

Overview

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.



397
398
399
# File 'lib/nexpose/site.rb', line 397

def initialize(hostname)
  @host = hostname
end

Instance Attribute Details

#hostObject

Named host (usually DNS or Netbios name).



395
396
397
# File 'lib/nexpose/site.rb', line 395

def host
  @host
end

Instance Method Details

#<=>(other) ⇒ Object



403
404
405
# File 'lib/nexpose/site.rb', line 403

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


407
408
409
# File 'lib/nexpose/site.rb', line 407

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

#hashObject



411
412
413
# File 'lib/nexpose/site.rb', line 411

def hash
  to_xml.hash
end

#to_xmlObject



421
422
423
# File 'lib/nexpose/site.rb', line 421

def to_xml
  to_xml_elem.to_s
end

#to_xml_elemObject



415
416
417
418
419
# File 'lib/nexpose/site.rb', line 415

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