Module: PacketGen::Header::SCTP::ErrorMixin

Overview

Common methods to all error causes

Author:

  • Sylvain Daubert

Since:

  • 3.4.0

Instance Method Summary collapse

Methods included from Padded32

#padded?, #to_s

Instance Method Details

#error_nameString

Get error name

Returns:

  • (String)

Since:

  • 3.4.0



19
20
21
# File 'lib/packetgen/header/sctp/error.rb', line 19

def error_name
  self.class.name.split('::').last.delete_suffix('Error')
end

#to_humanString

Returns:

  • (String)

Since:

  • 3.4.0



24
25
26
# File 'lib/packetgen/header/sctp/error.rb', line 24

def to_human
  "<#{error_name}: #{value}>"
end