Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Attribute Index hints on your data.
Perl

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
t
Build.PL
Changes
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README
perlcriticrc

README

NAME
    MooseX::AttributeIndexes - Advertise metadata about your
    Model-Representing Classes to Any Database tool.

VERSION
    version 0.01000300

SYNOPSIS
  Implementing Indexes
      package My::Package;
      use Moose;
      use MooseX::AttributeIndexes;
      use MooseX::Types::Moose qw( :all );

      has 'id' => (
        isa => Str,
        is  => 'rw',
        primary_index => 1,
      );

      has 'name' => (
        isa => Str,
        is  => 'rw',
        indexed => 1,
      );

      has 'foo' => (
        isa => Str,
        is  => 'rw',
      );

  Accessing Indexed Data
      package TestScript;

      use My::Package;

      my $foo = My::Package->new(
        id => "Bob",
        name => "Smith",
        foo  => "Bar",
      );

      $foo->attribute_indexes
      # { id => 'Bob', name => 'Smith' }

  Using With Search::GIN::Extract::Callback
      Search::GIN::Extract::Callback(
        extract => sub {
          my ( $obj, $callback, $args ) = @_;
          if( $obj->does( 'MooseX::AttributeIndexes::Provider') ){
            return $obj->attribute_indexes;
          }
        }
      );

METHODS
  init_meta
    Injects the traits for Indexed as default traits on all new attributes,
    and glues the 2 magical roles into your package.

AUTHOR
      Kent Fredric <kentnl@cpan.org>

COPYRIGHT AND LICENSE
    This software is copyright (c) 2009 by Kent Fredric.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

Something went wrong with that request. Please try again.