Class: SSLyze::XML::Resum::SessionResumptionWithSessionIDs

Inherits:
Object
  • Object
show all
Includes:
Attributes::IsSupported, Types
Defined in:
lib/sslyze/xml/resum/session_resumption_with_session_ids.rb

Overview

Represents the <sessionResumptionWithSessionIDs> XML element.

Since:

  • 1.0.0

Constant Summary

Constants included from Types

Types::Boolean, Types::None

Instance Method Summary collapse

Methods included from Attributes::IsSupported

#is_supported?

Constructor Details

#initialize(node) ⇒ SessionResumptionWithSessionIDs

Parameters:

  • node (Nokogiri::XML::Element)

    The <sessionResumptionWithSessionIDs> XML element.

Since:

  • 1.0.0



24
25
26
# File 'lib/sslyze/xml/resum/session_resumption_with_session_ids.rb', line 24

def initialize(node)
  @node = node
end

Instance Method Details

#each_error {|error| ... } ⇒ Enumerator

Enumerates over each error message.

Yields:

  • (error)

Yield Parameters:

  • error (String)

Returns:

  • (Enumerator)

    An enumerator will be returned if no block was given.

Since:

  • 1.0.0



74
75
76
77
78
79
80
# File 'lib/sslyze/xml/resum/session_resumption_with_session_ids.rb', line 74

def each_error
  return enum_for(__method__) unless block_given?

  @node.xpath('error').each do |error|
    yield error.inner_text
  end
end

#error_countInteger

The number of errors that occurred.

Returns:

  • (Integer)

Since:

  • 1.0.0



60
61
62
# File 'lib/sslyze/xml/resum/session_resumption_with_session_ids.rb', line 60

def error_count
  @error_count ||= @node['errors'].to_i
end

#errorsArray<String>

All error messages.

Returns:

  • (Array<String>)

Since:

  • 1.0.0



87
88
89
# File 'lib/sslyze/xml/resum/session_resumption_with_session_ids.rb', line 87

def errors
  each_error.to_a
end

#failed_attemptsInteger

Number of failed attempts.

Returns:

  • (Integer)

Since:

  • 1.0.0



33
34
35
# File 'lib/sslyze/xml/resum/session_resumption_with_session_ids.rb', line 33

def failed_attempts
  @failed_attempts ||= @node['failedAttempts'].to_i
end

#successful_attemptsInteger

Number of successful attempts.

Returns:

  • (Integer)

Since:

  • 1.0.0



42
43
44
# File 'lib/sslyze/xml/resum/session_resumption_with_session_ids.rb', line 42

def successful_attempts
  @successful_attempts ||= @node['successfulAttempts'].to_i
end

#total_attemptsInteger

Number of total attempts.

Returns:

  • (Integer)

Since:

  • 1.0.0



51
52
53
# File 'lib/sslyze/xml/resum/session_resumption_with_session_ids.rb', line 51

def total_attempts
  @total_attempts ||= @node['totalAttempts'].to_i
end