Class: McProtocolE::Frame3e::ErrorInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/mc_protocol_e/frame_3e/error_info.rb

Overview

This class shows a error information.

Instance Method Summary collapse

Constructor Details

#initialize(code, data, command) ⇒ ErrorInfo

Constructor.

Parameters:

  • code (Integer)

    MC protocol error code

  • data (String)

    response

  • command (Object)

    command



14
15
16
17
18
# File 'lib/mc_protocol_e/frame_3e/error_info.rb', line 14

def initialize(code, data, command)
  @code = code
  @access_route = AccessRoute.from_raw(data[0..4])
  @command = command
end

Instance Method Details

#to_sString

Returns binary string.

Returns:

  • (String)

    binary string



22
23
24
# File 'lib/mc_protocol_e/frame_3e/error_info.rb', line 22

def to_s
  "code: #{code.to_s(16)} command: #{command.class.name} #{access_route}"
end