Mercurial > pub > Impl
comparison Lib/IMPL/Config/Path.pm @ 259:b92f19630d33
Merge with 91bae9f41a9cf2d52f5cff5a5c3e7c8683c7d47e
| author | sergey |
|---|---|
| date | Fri, 21 Dec 2012 00:09:11 +0400 |
| parents | 91bae9f41a9c |
| children | 212cc86e470b |
comparison
equal
deleted
inserted
replaced
| 257:299af584c05f | 259:b92f19630d33 |
|---|---|
| 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 => 'AppBase', | |
| 19 configBase => 'ConfigBase' | |
| 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; |
