package Xot::Index; use base 'Xot::Accessors'; use Xot::Index::Field; use strict; Xot::Index->plain(qw(name method where type table index_function)); Xot::Index->multi('index_field' => 'Xot::Index::Field'); sub init { my ($self, $table, $twig) = splice @_, 0, 3; foreach my $att (qw(name method where type index_function)) { $self->$att($twig->att($att)) if $twig->att($att); } $self->table($table); $self->twig($twig); $self->add_index_field($_) foreach ($twig->children('index_field')); } 1;