Class: McProtocolE::Frame3e::BaseCommand

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

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ BaseCommand

Returns a new instance of BaseCommand.



12
13
14
# File 'lib/mc_protocol_e/frame_3e/base_command.rb', line 12

def initialize(command)
  @command = command
end

Instance Method Details

#parse(res) ⇒ Object

Raises:



16
17
18
# File 'lib/mc_protocol_e/frame_3e/base_command.rb', line 16

def parse(res)
  raise CommandError, ErrorInfo.new(res.code, res.data, self).to_s unless res.succeed?
end