Class: GetTypeHandler
- Inherits:
-
AbstractCommandHandler
- Object
- AbstractCommandHandler
- GetTypeHandler
- Defined in:
- lib/javonet-ruby-sdk/core/handler/command_handler/get_type_handler.rb,
lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/command_handler/get_type_handler.rb,
lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/command_handler/get_type_handler.rb,
lib/javonet-ruby-sdk/Binaries/Ruby/Windows/X64/core/handler/command_handler/get_type_handler.rb
Instance Method Summary collapse
-
#initialize ⇒ GetTypeHandler
constructor
A new instance of GetTypeHandler.
- #process(command) ⇒ Object
Methods inherited from AbstractCommandHandler
Constructor Details
#initialize ⇒ GetTypeHandler
Returns a new instance of GetTypeHandler.
4 5 6 |
# File 'lib/javonet-ruby-sdk/core/handler/command_handler/get_type_handler.rb', line 4 def initialize @required_parameters_count = 1 end |
Instance Method Details
#process(command) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/javonet-ruby-sdk/core/handler/command_handler/get_type_handler.rb', line 8 def process(command) begin if command.payload.length < @required_parameters_count raise ArgumentError.new "Get Type parameters mismatch" end if command.payload.length > @required_parameters_count return Object::const_get(command.payload[1]) else return Object::const_get(command.payload[0]) end rescue Exception => e return e end end |