comparison lib/IMPL/Config/Path.pm @ 407:c6e90e02dd17 ref20150831

renamed Lib->lib
author cin
date Fri, 04 Sep 2015 19:40:23 +0300
parents
children
comparison
equal deleted inserted replaced
406:f23fcb19d3c1 407:c6e90e02dd17
1 package IMPL::Config::Path;
2 use strict;
3 use IMPL::Config();
4
5 use IMPL::require {
6 Exception => 'IMPL::Exception',
7 OpException => '-IMPL::InvalidOperationException'
8 };
9
10 sub restore {
11 my ($self,$data,$surrogate) = @_;
12
13 die OpException->new("Invalid content") unless ref $data eq 'ARRAY' && @$data == 2;
14
15 my ($base,$path) = @$data;
16
17 my %types = (
18 appBase => 'AppDir',
19 configBase => 'ConfigDir'
20 );
21
22 my $method = $types{$base};
23
24 die OpException->new("Unsupported path type",$base) unless $method;
25
26 return IMPL::Config->$method($path);
27 }
28
29 1;