4 use Class::Tiny::_Utils;
11 *{_getglob("${target}::extends")} = sub {
12 *{_getglob("${target}::ISA")} = \@_;
14 *{_getglob("${target}::with")} = sub {
16 die "Only one role supported at a time by with" if @_ > 1;
17 Role::Tiny->apply_role_to_package($_[0], $target);
19 *{_getglob("${target}::has")} = sub {
20 my ($name, %spec) = @_;
21 ($MAKERS{$target}{accessor} ||= do {
22 require Method::Generate::Accessor;
23 Method::Generate::Accessor->new
24 })->generate_method($target, $name, \%spec);
25 ($MAKERS{$target}{constructor} ||= do {
26 require Method::Generate::Constructor;
27 Method::Generate::Constructor->new(package => $target)->install_delayed
28 })->register_attribute_spec($name, \%spec);
30 foreach my $type (qw(before after around)) {
31 *{_getglob "${target}::${type}"} = sub {
32 _install_modifier($target, $type, @_);
37 @{"${target}::ISA"} = do {
38 require Class::Tiny::Object; ('Class::Tiny::Object');
39 } unless @{"${target}::ISA"};