Sha256: 35a7b44481edfce281ef4edebc959ecdb7b7b05a4d986b3621df90e3d9830a10
Contents?: true
Size: 1.4 KB
Versions: 43
Compression:
Stored size: 1.4 KB
Contents
package Javonet::Core::Handler::CommandHandler::AbstractCommandHandler; use strict; use warnings FATAL => 'all'; use Moose; use Scalar::Util qw( blessed ); use Attribute::Abstract; sub new { my $class = shift; my $self = { required_parameters_count => 0 }; return bless $self, $class; } sub handle_command { my ($self, $command) = @_; iterate($command); return $self->process($command); } sub iterate { my $command = shift; my $payload_ref = $command->{payload}; my @payload_array = @$payload_ref; my $length = @payload_array; for (my $i=0; $i< $length; $i++){ my $payload_item = $command->{payload}[$i]; if(blessed($payload_item) and $payload_item->isa('Javonet::Sdk::Core::PerlCommand') and !($payload_item->{command_type} eq Javonet::Sdk::Core::PerlCommandType::get_command_type('Value'))) { $command->{payload}[$i] = Javonet::Core::Handler::HandlerDictionary::get_handler( $command->{payload}[$i]->{command_type})->handle_command($command->{payload}[$i] ); } if(blessed($payload_item) and $payload_item->isa('Javonet::Sdk::Core::PerlCommand') and $payload_item->{command_type} eq Javonet::Sdk::Core::PerlCommandType::get_command_type('Value')) { $command->{payload}[$i] = $payload_item->{payload}[0]; } } } sub process : Abstract; no Moose; 1;
Version data entries
43 entries across 26 versions & 1 rubygems