use Carp ();
-use Any::Moose;
-use Any::Moose 'Util' => [ qw<find_meta does_role> ];
-use Any::Moose 'Util::TypeConstraints';
+use Mouse;
+use Mouse::Util qw<find_meta does_role>;
+use Mouse::Util::TypeConstraints;
=head1 ATTRIBUTES
=head1 METHODS
-=head2 C<< new target => $target, handler => $handler >>
+=head2 C<new>
+
+ my $rule = LaTeX::TikZ::Functor::Rule->new(
+ target => $target,
+ handler => $handler,
+ );
Constructs a new rule object with target C<$target> and handler C<$handler>.
my $meta = find_meta($target);
Carp::confess("No meta object associated with target $target")
unless defined $meta;
- $args{is_role} = $meta->isa(any_moose('Meta::Role'));
+ $args{is_role} = $meta->isa('Mouse::Meta::Role');
my $is_set;
if (does_role($target, 'LaTeX::TikZ::Set')) {
$class->$orig(%args);
};
-=head2 C<< insert into => \@list, overwrite => $overwrite, replace => $replace >>
+=head2 C<insert>
+
+ my $has_replaced = $rule->insert(
+ into => \@list,
+ overwrite => $overwrite,
+ replace => $replace,
+ );
Inserts the current rule into the list of rules C<@list>.
The list is expected to be ordered, in that each rule must come after all the rules that have a target that inherits or consumes the original rule's own target.
}
if (defined $pos) {
- splice @$list, $pos, 1, $rule;
+ splice @$list, $pos, 0, $rule;
return 0;
}
}
return 0;
}
-=head2 C<handles $obj>
+=head2 C<handles>
+
+ $rule->handles($obj);
Returns true if and only if the current rule can handle the object or class/role name C<$obj>.
=head1 COPYRIGHT & LICENSE
-Copyright 2010 Vincent Pit, all rights reserved.
+Copyright 2010,2011,2012,2013,2014,2015 Vincent Pit, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.