Class: Ikra::Translator::CommandTranslator::CommandTranslationResult

Inherits:
Object
  • Object
show all
Defined in:
lib/translator/commands/command_translator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(execution: "", result:, command:) ⇒ CommandTranslationResult

Returns a new instance of CommandTranslationResult.



31
32
33
34
35
# File 'lib/translator/commands/command_translator.rb', line 31

def initialize(execution: "", result:, command:)
    @execution = execution
    @command = command
    @result = result;
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



29
30
31
# File 'lib/translator/commands/command_translator.rb', line 29

def command
  @command
end

#executionObject (readonly)

Source code that performs the computation of this command for one thread. May consist of multiple statement. Optional.



22
23
24
# File 'lib/translator/commands/command_translator.rb', line 22

def execution
  @execution
end

#resultObject (readonly)

Source code that returns the result of the computation. If the computation can be expressed in a single expression, this string can contain the entire computation and ‘execution` should then be empty.



27
28
29
# File 'lib/translator/commands/command_translator.rb', line 27

def result
  @result
end

Instance Method Details

#result_typeObject



37
38
39
# File 'lib/translator/commands/command_translator.rb', line 37

def result_type
    return command.result_type
end