File Coverage

blib/lib/Win32/SqlServer/DTS/Assignment/EnvVar.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Win32::SqlServer::DTS::Assignment::EnvVar;
2            
3             =head1 NAME
4            
5             Win32::SqlServer::DTS::Assignment::EnvVar - a class to represent a DynamicPropertiesTaskAssignment object
6            
7             =head1 SYNOPSIS
8            
9             use warnings;
10             use strict;
11             use Win32::SqlServer::DTS::Application;
12             use Test::More;
13             use XML::Simple;
14            
15             my $xml = XML::Simple->new();
16             my $config = $xml->XMLin('test-config.xml');
17            
18             my $app = Win32::SqlServer::DTS::Application->new($config->{credential});
19            
20             my $package =
21             $app->get_db_package(
22             { id => '', version_id => '', name => $config->{package}, package_password => '' } );
23            
24             my $iterator = $package->get_dynamic_props();
25            
26             while ( my $dyn_prop = $iterator->() ) {
27            
28             foreach my $assignment_prop() ( @{ $dyn_prop->get_properties() } ) {
29            
30             if ( $assignment_prop->get_type() eq 'EnvVar' ) {
31            
32             print $assignment_prop->to_string(), "\n";
33            
34             }
35            
36             }
37             }
38            
39            
40             =head1 DESCRIPTION
41            
42             C is a subclass of L superclass. It represents
43             a DTS C object that has a C property defined.
44            
45             Unless you want to extend the C API is quite probably that you're going to use C
46             returned by the C method from C class.
47            
48             =head2 EXPORT
49            
50             Nothing.
51            
52             =cut
53            
54 1     1   28098 use strict;
  1         3  
  1         35  
55 1     1   6 use warnings;
  1         2  
  1         28  
56 1     1   5 use base qw(Win32::SqlServer::DTS::Assignment);
  1         2  
  1         642  
57             use Hash::Util qw(lock_keys);
58            
59             =head2 METHODS
60            
61             Inherits all methods from C.
62            
63             =head3 new
64            
65             Extends superclass method C by modifying the C attribute.
66            
67             =cut
68            
69             sub new {
70            
71             my $class = shift;
72             my $self = $class->SUPER::new(@_);
73            
74             $self->{source} = $self->get_sibling->SourceEnvironmentVariable;
75            
76             lock_keys( %{$self} );
77            
78             return $self;
79            
80             }
81            
82             =head3 get_source
83            
84             Overrided method from L class. Returns a string returns the name of an environment
85             variable that contains the value to which a Data Transformation Services (DTS) package object property will be set
86             by the DynamicPropertiesTask object. See L method for more information.
87            
88             =cut
89            
90             sub get_source {
91            
92             my $self = shift;
93             return $self->{source};
94            
95             }
96            
97             1;
98             __END__