Beam-Wire

 view release on metacpan or  search on metacpan

lib/Beam/Wire.pm  view on Meta::CPAN

        return $_[0];
    },
);

#pod =attr config
#pod
#pod The raw configuration data. By default, this data is loaded by
#pod L<Config::Any|Config::Any> using the file specified by the L<file attribute|/file>.
#pod
#pod See L<Beam::Wire::Help::Config for details on what the configuration
#pod data structure looks like|Beam::Wire::Help::Config>.
#pod
#pod If you don't want to load a file, you can specify this attribute in the
#pod Beam::Wire constructor.
#pod
#pod =cut

has config => (
    is      => 'ro',
    isa     => HashRef,
    lazy    => 1,

lib/Beam/Wire.pm  view on Meta::CPAN

The directory path to use when searching for inner container files.
Defaults to the directory which contains the file specified by the
L<file attribute|/file>.

=head2 config

The raw configuration data. By default, this data is loaded by
L<Config::Any|Config::Any> using the file specified by the L<file attribute|/file>.

See L<Beam::Wire::Help::Config for details on what the configuration
data structure looks like|Beam::Wire::Help::Config>.

If you don't want to load a file, you can specify this attribute in the
Beam::Wire constructor.

=head2 services

A hashref of cached services built from the L<configuration|/config>. If
you want to inject a pre-built object for other services to depend on,
add it here.

t/service/ref.t  view on Meta::CPAN

use Test::More;
use Test::Exception;
use Test::Lib;
use Scalar::Util qw( refaddr );
use Beam::Wire;

package TestClass {
    sub new { return bless {}, $_[0] }
    sub greeting { return 'Hello, World' }
}
$INC{'TestClass.pm'} = 'TestClass.pm';    # so module looks like it's been loaded.


subtest 'ref service: $call' => sub {
    my $wire = Beam::Wire->new(
        config => {
            klass => {
               '$class' => 'TestClass',
            },
            greeting => {
                '$ref' => 'klass',



( run in 0.342 second using v1.01-cache-2.11-cpan-64827b87656 )