annotate lib/IMPL/Config/YAMLConfig.pm @ 420:df591e3afd10 ref20150831

sync
author cin
date Sat, 25 Feb 2017 22:35:26 +0300
parents bbc4739c4d48
children 7798345304bc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
418
cin
parents:
diff changeset
1 package IMPL::Config::YAMLConfig;
cin
parents:
diff changeset
2 use strict;
cin
parents:
diff changeset
3
419
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
4 use IMPL::lang qw(:base);
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
5 use IMPL::Exception();
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
6 use YAML::XS();
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
7
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
8 sub Load {
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
9 my ( $this, $container, $file ) = @_;
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
10
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
11 $this->Configure( isscalar($file)
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
12 ? YAML::XS::Load( ${$file} )
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
13 : YAML::XS::LoadFile($file) );
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
14 }
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
15
418
cin
parents:
diff changeset
16 sub Configure {
419
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
17 my ( $this, $container, $config ) = @_;
418
cin
parents:
diff changeset
18
419
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
19
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
20
418
cin
parents:
diff changeset
21 }
cin
parents:
diff changeset
22
cin
parents:
diff changeset
23 1;
cin
parents:
diff changeset
24
cin
parents:
diff changeset
25 __END__
cin
parents:
diff changeset
26
cin
parents:
diff changeset
27 =pod
cin
parents:
diff changeset
28
cin
parents:
diff changeset
29
419
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
30 =cut