Sha256: ba7dcad76155160ef9b29685d45c303ca377881196c86af2f2ddb81918c4caac
Contents?: true
Size: 1.12 KB
Versions: 6
Compression:
Stored size: 1.12 KB
Contents
package Javonet::Core::Handler::CommandHandler::GetInstanceFieldHandler; use aliased 'Javonet::Core::Handler::PerlHandler' => 'PerlHandler'; use strict; use warnings FATAL => 'all'; use Moose; use lib 'lib'; use lib 'data_seed'; use Nice::Try; use Data::Dumper; use aliased 'Javonet::Core::Handler::Exception' => 'Exception'; extends 'Javonet::Core::Handler::CommandHandler::AbstractCommandHandler'; sub new { my $class = shift; my $self = { required_parameters_count => 2 }; return bless $self, $class; } sub process { my ($self, $command) = @_; try { my $current_payload_ref = $command->{payload}; my @cur_payload = @$current_payload_ref; my $parameters_length = @cur_payload; if ($parameters_length < $self->{required_parameters_count}){ die Exception->new("Exception: GetInstanceField parameters mismatch"); } my $class_name = $command->{payload}[0]; my $static_field_name = $command->{payload}[1]; my $var = $class_name->{$static_field_name}; return $var; } catch ( $e ) { return $e ; } } no Moose; 1;
Version data entries
6 entries across 3 versions & 1 rubygems