| 1 | package Geoffrey::Action::Function; | ||||||||||
| 2 | |||||||||||
| 3 | 6 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 6 | ▶ | use 5.016; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 6 | $Geoffrey::Action::Function::VERSION = '0.000206'; | |||||||||
| 9 | |||||||||||
| 10 | 6 | ▶ | use parent 'Geoffrey::Role::Action'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 4 | ▶ | sub add { | ||||||||
|
Subroutine
add: called CC=4 SCAR=17.9
Pod
documented
| |||||||||||
| 13 | 4 | my ( $self, $hr_params ) = @_; | |||||||||
| 14 | 4 | my $function = $self->converter->function; | |||||||||
| 15 | 2 | ▶ | if ( !$function ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 0 | require Geoffrey::Exception::NotSupportedException; | |||||||||
| 17 | 0 | Geoffrey::Exception::NotSupportedException::throw_converter_type(); | |||||||||
| 18 | } | ||||||||||
| 19 | 2 | ▶ | if ( !$function->add ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 0 | require Geoffrey::Exception::NotSupportedException; | |||||||||
| 21 | 0 | Geoffrey::Exception::NotSupportedException::throw_action(); | |||||||||
| 22 | } | ||||||||||
| 23 | 1 | require Ref::Util; | |||||||||
| 24 | 1 | ▶ | if ( !Ref::Util::is_hashref($hr_params) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 1 | require Geoffrey::Exception::General; | |||||||||
| 26 | 1 | Geoffrey::Exception::General::throw_wrong_ref( __PACKAGE__ . '::add', 'hash' ); | |||||||||
| 27 | } | ||||||||||
| 28 | 0 | my $args = join q/,/, @{ $hr_params->{args} }; | |||||||||
| 29 | 0 | require Geoffrey::Utils; | |||||||||
| 30 | return $self->do( | ||||||||||
| 31 | Geoffrey::Utils::replace_spare( | ||||||||||
| 32 | $function->add, | ||||||||||
| 33 | [ | ||||||||||
| 34 | $hr_params->{name}, $args, | ||||||||||
| 35 | $hr_params->{result_data_type}, $hr_params->{prosrc}, | ||||||||||
| 36 | $hr_params->{language}, $hr_params->{cost}, | ||||||||||
| 37 | 0 | ] | |||||||||
| 38 | ) | ||||||||||
| 39 | ); | ||||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 6 | ▶ | sub list { | ||||||||
|
Subroutine
list: called CC=3 SCAR=13.6
Pod
documented
| |||||||||||
| 43 | 6 | my ( $self, $schema ) = @_; | |||||||||
| 44 | 6 | my $function = $self->converter->function; | |||||||||
| 45 | 3 | ▶ | if ( !$function ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | 0 | require Geoffrey::Exception::NotSupportedException; | |||||||||
| 47 | 0 | Geoffrey::Exception::NotSupportedException::throw_converter_type(); | |||||||||
| 48 | } | ||||||||||
| 49 | 3 | ▶ | if ( !$function->list ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | 0 | require Geoffrey::Exception::NotSupportedException; | |||||||||
| 51 | 0 | Geoffrey::Exception::NotSupportedException::throw_action(); | |||||||||
| 52 | } | ||||||||||
| 53 | 1 | return $function->information( $self->do_arrayref( $function->list($schema) ) ); | |||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | 6 | 1; | |||||||||
| 57 | |||||||||||
| 58 | __END__ | ||||||||||