https://github.com/preaction/beam-service
A service role for objects to access Beam::Wire features
https://github.com/preaction/beam-service
Last synced: about 1 year ago
JSON representation
A service role for objects to access Beam::Wire features
- Host: GitHub
- URL: https://github.com/preaction/beam-service
- Owner: preaction
- License: other
- Created: 2017-05-05T04:35:19.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-05T05:00:53.000Z (about 9 years ago)
- Last Synced: 2024-06-21T03:22:41.944Z (about 2 years ago)
- Language: Perl
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.mkdn
- Changelog: CHANGES
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Beam::Service - Role for services to access Beam::Wire features
# VERSION
version 0.001
# STATUS
# SYNOPSIS
package My::Object;
use Role::Tiny::With; # or Moo, or Moose
with 'Beam::Service';
package main;
use Beam::Wire;
my $wire = Beam::Wire->new(
config => {
my_object => {
'$class' => 'My::Object',
},
},
);
print $wire->get( 'my_object' )->name; # my_object
# DESCRIPTION
This role adds extra functionality to an object that is going to be used
as a service in a [Beam::Wire](https://metacpan.org/pod/Beam::Wire) container. While any object can be
configured with Beam::Wire, consuming the Beam::Service role allows an
object to know its own name and to access the container it was
configured in to fetch other objects that it needs.
# ATTRIBUTES
## name
The name of the service. This is the name used in the [Beam::Wire](https://metacpan.org/pod/Beam::Wire)
configuration file for this service.
## container
The [Beam::Wire](https://metacpan.org/pod/Beam::Wire) container object that contained this service. Using
this container we can get other services as-needed.
# SEE ALSO
[Beam::Wire](https://metacpan.org/pod/Beam::Wire)
# AUTHOR
Doug Bell
# COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Doug Bell.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
