initial import
[scpubgit/Object-Inline.git] / lib / Object / Inline.pm
CommitLineData
22e75839 1package Object::Inline;
2
3use strictures 1;
4use Package::Variant ();
5use Import::Into;
6
7sub import {
8 my $class = shift;
9 my $target = caller;
10 Package::Variant->import::into(
11 $target,
12 no_import => 1, make_variant => sub { $_[2]->($_[1]) },
13 @_,
14 );
15 no strict 'refs';
16 *{"${target}::object"} = sub (&;@) {
17 my $code = shift;
18 Package::Variant->build_variant_of($target, $code)->new(@_);
19 };
20}
21
221;