Exception: PacketConversionException

Inherits:
StandardError
  • Object
show all
Defined in:
client/packet_exceptions.rb

Overview

The Packet Conversion Exception inherits from the StandardError. It is used when an error occurs converting from an object of type Packet to something else.

Author:

  • Joseph Beck

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = 'Failed to convert Packet to other Object', exception_type = 'PacketConversionException') ⇒ NilClass

The constructor of this class takes in a msg and defaults just like the exception type. This then calls the superclass’ constructor with.

Parameters:

  • (String, String)


24
25
26
27
# File 'client/packet_exceptions.rb', line 24

def initialize(msg = 'Failed to convert Packet to other Object', exception_type = 'PacketConversionException')
  @exception_type = exception_type
  super(msg)
end

Instance Attribute Details

#:exception_type(: exception_type) ⇒ Object

The exception type may require use outside of the instance of itself and therefore has an attribute accessor.



16
# File 'client/packet_exceptions.rb', line 16

attr_accessor :exception_type

#exception_typeObject

The exception type may require use outside of the instance of itself and therefore has an attribute accessor.



16
17
18
# File 'client/packet_exceptions.rb', line 16

def exception_type
  @exception_type
end