Class: SorobanRustBackend::InstructionHandler
- Inherits:
-
Object
- Object
- SorobanRustBackend::InstructionHandler
- Defined in:
- lib/instruction_handler.rb
Overview
This class is responsible for generating Rust code for a single instruction.
Instance Method Summary collapse
- #generate_rust ⇒ Object
-
#initialize(instruction, metadata) ⇒ InstructionHandler
constructor
A new instance of InstructionHandler.
Constructor Details
#initialize(instruction, metadata) ⇒ InstructionHandler
Returns a new instance of InstructionHandler.
4 5 6 7 |
# File 'lib/instruction_handler.rb', line 4 def initialize(instruction, ) @instruction = instruction = end |
Instance Method Details
#generate_rust ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/instruction_handler.rb', line 9 def generate_rust unless EXPRESSION_FOOBAR.key?(@instruction.instruction.strip) raise "Unknown instruction type: #{@instruction.instruction}" end EXPRESSION_FOOBAR[@instruction.instruction.strip].send(:handle, @instruction, ) end |