Class: AbstractCommandHandler
- Inherits:
-
Object
- Object
- AbstractCommandHandler
show all
- Defined in:
- lib/javonet-ruby-sdk/core/handler/abstract_command_handler.rb,
lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/abstract_command_handler.rb,
lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/abstract_command_handler.rb,
lib/javonet-ruby-sdk/Binaries/Ruby/Windows/X64/core/handler/abstract_command_handler.rb
Direct Known Subclasses
ArrayGetItemHandler, ArrayGetRankHandler, ArrayGetSizeHandler, ArrayHandler, ArraySetItemHandler, CastingHandler, CreateClassInstanceHandler, DestructReferenceHandler, EnableNamespaceHandler, EnableTypeHandler, GetInstanceFieldHandler, GetStaticFieldHandler, GetTypeHandler, InvokeInstanceMethodHandler, InvokeStaticMethodHandler, LoadLibraryHandler, ResolveInstanceHandler, SetInstanceFieldHandler, SetStaticFieldHandler, ValueHandler
Instance Method Summary
collapse
Instance Method Details
#handle_command(command) ⇒ Object
7
8
9
10
|
# File 'lib/javonet-ruby-sdk/core/handler/abstract_command_handler.rb', line 7
def handle_command(command)
iterate(command)
return process(command)
end
|
#iterate(command) ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/javonet-ruby-sdk/core/handler/abstract_command_handler.rb', line 12
def iterate(command)
(0..command.payload.length).step(1) do |i|
if command.payload[i].is_a? Command
command.payload[i] = $handler_dict[command.payload[i].command_type].handle_command(command.payload[i])
end
end
end
|
#process(command) ⇒ Object
20
21
22
|
# File 'lib/javonet-ruby-sdk/core/handler/abstract_command_handler.rb', line 20
def process(command)
raise 'process is not implemented'
end
|