Class: SSLyze::XML::InvalidTarget

Inherits:
Object
  • Object
show all
Includes:
Attributes::Error
Defined in:
lib/sslyze/xml/invalid_target.rb

Overview

Represents the <invalidTarget> XML element.

Instance Method Summary collapse

Methods included from Attributes::Error

#error, #error?

Constructor Details

#initialize(node) ⇒ InvalidTarget

Initializes the invalid target.

Parameters:

  • node (Nokogiri::XML::Node)

    The <invalid> XML element.



18
19
20
# File 'lib/sslyze/xml/invalid_target.rb', line 18

def initialize(node)
  @node = node
end

Instance Method Details

#hostString

The host component of the target.

Returns:

  • (String)


38
39
40
# File 'lib/sslyze/xml/invalid_target.rb', line 38

def host
  @host ||= target.split(':',2).first
end

#portInteger

The port component of the target.

Returns:

  • (Integer)

Since:

  • 1.1.0



49
50
51
# File 'lib/sslyze/xml/invalid_target.rb', line 49

def port
  @port ||= target.split(':',2).last.to_i
end

#targetString

The target name.

Returns:

  • (String)

Since:

  • 1.1.0



29
30
31
# File 'lib/sslyze/xml/invalid_target.rb', line 29

def target
  @target ||= @node.inner_text
end