| 1 | |||||||||||
| 2 | package VoiceXML::Client::Item::Assign; | ||||||||||
| 3 | |||||||||||
| 4 | |||||||||||
| 5 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | |||||||||||
| 8 | 3 | ▶ | use base qw (VoiceXML::Client::Item); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 3 | ▶ | use VoiceXML::Client::Util; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 3 | ▶ | use vars qw{ | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | $VERSION | ||||||||||
| 13 | 3 | }; | |||||||||
| 14 | |||||||||||
| 15 | 3 | $VERSION = $VoiceXML::Client::Item::VERSION; | |||||||||
| 16 | |||||||||||
| 17 | |||||||||||
| 18 | |||||||||||
| 19 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 20 | |||||||||||
| 21 | |||||||||||
| 22 | Copyright (C) 2007,2008 by Pat Deegan. | ||||||||||
| 23 | All rights reserved | ||||||||||
| 24 | http://voicexml.psychogenic.com | ||||||||||
| 25 | |||||||||||
| 26 | This library is released under the terms of the GNU GPL version 3, making it available only for | ||||||||||
| 27 | free programs ("free" here being used in the sense of the GPL, see http://www.gnu.org for more details). | ||||||||||
| 28 | Anyone wishing to use this library within a proprietary or otherwise non-GPLed program MUST contact psychogenic.com to | ||||||||||
| 29 | acquire a distinct license for their application. This approach encourages the use of free software | ||||||||||
| 30 | while allowing for proprietary solutions that support further development. | ||||||||||
| 31 | |||||||||||
| 32 | |||||||||||
| 33 | This file is part of VoiceXML::Client. | ||||||||||
| 34 | |||||||||||
| 35 | |||||||||||
| 36 | |||||||||||
| 37 | VoiceXML::Client is free software: you can redistribute it and/or modify | ||||||||||
| 38 | it under the terms of the GNU General Public License as published by | ||||||||||
| 39 | the Free Software Foundation, either version 3 of the License, or | ||||||||||
| 40 | (at your option) any later version. | ||||||||||
| 41 | |||||||||||
| 42 | VoiceXML::Client is distributed in the hope that it will be useful, | ||||||||||
| 43 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||
| 44 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||||||||
| 45 | GNU General Public License for more details. | ||||||||||
| 46 | |||||||||||
| 47 | You should have received a copy of the GNU General Public License | ||||||||||
| 48 | along with VoiceXML::Client. If not, see <http://www.gnu.org/licenses/>. | ||||||||||
| 49 | |||||||||||
| 50 | |||||||||||
| 51 | =cut | ||||||||||
| 52 | |||||||||||
| 53 | |||||||||||
| 54 | |||||||||||
| 55 | |||||||||||
| 56 | 10 | ▶ | sub init { | ||||||||
|
Subroutine
init: called CC=3 SCAR=11.5
Pod
documented
| |||||||||||
| 57 | 10 | my $self = shift; | |||||||||
| 58 | |||||||||||
| 59 | 10 | my $name = $self->{'XMLElement'}->attribute('name'); | |||||||||
| 60 | 10 | my $val = $self->{'XMLElement'}->attribute('expr') ; | |||||||||
| 61 | |||||||||||
| 62 | 10 | ▶ | $val = '' unless (defined $val); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 63 | |||||||||||
| 64 | 10 | ▶ | unless (defined $name) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 65 | { | ||||||||||
| 66 | 0 | VoiceXML::Client::Util::log_msg("Assign:init() no name set for element (with expr $val)"); | |||||||||
| 67 | 0 | return undef; | |||||||||
| 68 | } | ||||||||||
| 69 | |||||||||||
| 70 | 10 | my $vxmlDoc = $self->getParentVXMLDocument()->registerVariable($name); | |||||||||
| 71 | |||||||||||
| 72 | |||||||||||
| 73 | 10 | $self->{'name'} = $name; | |||||||||
| 74 | 10 | $self->{'expr'} = $val; | |||||||||
| 75 | |||||||||||
| 76 | 10 | return 1; | |||||||||
| 77 | |||||||||||
| 78 | |||||||||||
| 79 | } | ||||||||||
| 80 | |||||||||||
| 81 | 3 | ▶ | sub execute { | ||||||||
|
Subroutine
execute: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 82 | 3 | my $self = shift; | |||||||||
| 83 | 3 | my $handle = shift; | |||||||||
| 84 | 3 | my $optParams = shift; | |||||||||
| 85 | |||||||||||
| 86 | 3 | ▶ | VoiceXML::Client::Util::log_msg("ASSIGN SETTING $self->{'name'} to '$self->{'expr'}'") if ($VoiceXML::Client::Debug > 1); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 87 | |||||||||||
| 88 | 3 | VoiceXML::Client::Item::Util->assignVariable($self, $self->{'name'}, $self->{'expr'}); | |||||||||
| 89 | |||||||||||
| 90 | |||||||||||
| 91 | |||||||||||
| 92 | 3 | return $self->executeChildren($handle, $optParams); | |||||||||
| 93 | } | ||||||||||
| 94 | |||||||||||
| 95 | |||||||||||
| 96 | |||||||||||
| 97 | |||||||||||
| 98 | 3 | 1; | |||||||||