Class: Interpreter
- Inherits:
-
Object
- Object
- Interpreter
- Defined in:
- lib/javonet-ruby-sdk/core/interpreter/interpreter.rb,
lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/interpreter/interpreter.rb,
lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/interpreter/interpreter.rb,
lib/javonet-ruby-sdk/Binaries/Ruby/Windows/X64/core/interpreter/interpreter.rb more...
Instance Method Summary collapse
- #execute(command, connection_type, tcp_connection_data) ⇒ Object
- #process(byte_array, byte_array_len) ⇒ Object
Instance Method Details
#execute(command, connection_type, tcp_connection_data) ⇒ Object
[View source]
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/javonet-ruby-sdk/core/interpreter/interpreter.rb', line 6 def execute(command, connection_type, tcp_connection_data) command_serializer = CommandSerializer.new = command_serializer.serialize(command, connection_type, tcp_connection_data) if command.runtime_name == RuntimeName::RUBY && connection_type == ConnectionType::IN_MEMORY require_relative '../receiver/receiver' response_byte_array = Receiver.new.send_command(, .length) else require_relative '../transmitter/transmitter' response_byte_array = Transmitter.send_command(, .length) end command_deserializer = CommandDeserializer.new(response_byte_array,response_byte_array.length) command_deserializer.deserialize end |
#process(byte_array, byte_array_len) ⇒ Object
[View source]
22 23 24 25 26 27 28 |
# File 'lib/javonet-ruby-sdk/core/interpreter/interpreter.rb', line 22 def process(byte_array, byte_array_len) command_deserializer = CommandDeserializer.new(byte_array,byte_array_len) received_command = command_deserializer.deserialize handler = Handler.new command_serializer = CommandSerializer.new command_serializer.serialize(handler.handle_command(received_command)) end |