Path::Resolver::Resolver::Mux::Ordered - multiplex resolvers by checking them in order


Path-Resolver documentation  | view source Contained in the Path-Resolver distribution.

Index


NAME

Top

Path::Resolver::Resolver::Mux::Ordered - multiplex resolvers by checking them in order

VERSION

Top

version 3.100451

SYNOPSIS

Top

  my $resolver = Path::Resolver::Resolver::Mux::Ordered->new({
    resolvers => [
      $resolver_1,
      $resolver_2,
      ...
    ],
  });

  my $simple_entity = $resolver->entity_at('foo/bar.txt');

This resolver looks in each of its resolvers in order and returns the result of the first of its sub-resolvers to find the named entity. If no entity is found, it returns false as usual.

The default native type of this resolver is Any, meaning that is is much more lax than other resolvers. A native_type can be specified while creating the resolver.

ATTRIBUTES

Top

resolvers

This is an array of other resolvers. When asked for content, the Mux::Ordered resolver will check each resolver in this array and return the first found content, or false if none finds any content.

METHODS

Top

unshift_resolver

This method will add a resolver to the beginning of the list of consulted resolvers.

push_resolver

This method will add a resolver to the end of the list of consulted resolvers.

AUTHOR

Top

Ricardo Signes <rjbs@cpan.org>

COPYRIGHT AND LICENSE

Top


Path-Resolver documentation  | view source Contained in the Path-Resolver distribution.