| 1 | package Koha::Contrib::Tamil::Authority::Task; | ||
| 2 | $Koha::Contrib::Tamil::Authority::Task::VERSION = '0.072'; | ||
| 3 | # ABSTRACT: Base class for managing authorities manipulations | ||
| 4 | use Moose; | ||
| 5 | |||
| 6 | extends 'AnyEvent::Processor'; | ||
| 7 | |||
| 8 | use 5.010; | ||
| 9 | use utf8; | ||
| 10 | use Carp; | ||
| 11 | use YAML qw( LoadFile ); | ||
| 12 | |||
| 13 | has conf_authorities => ( is => 'rw', isa => 'ArrayRef' ); | ||
| 14 | |||
| 15 | has conf_file => ( | ||
| 16 | is => 'rw', | ||
| 17 | isa => 'Str', | ||
| 18 | trigger => sub { | ||
| 19 | my ($self, $file) = @_; | ||
| 20 | unless ( -e $file ) { | ||
| 21 | croak "File doesn't exist: " . $file; | ||
| 22 | } | ||
| 23 | my @authorities = LoadFile( $file ) or croak "Load conf auth impossible"; | ||
| 24 | $self->conf_authorities( \@authorities ); | ||
| 25 | } | ||
| 26 | ); | ||
| 27 | |||
| 28 | |||
| 29 | no Moose; | ||
| 30 | __PACKAGE__->meta->make_immutable; | ||
| 31 | 1; | ||
| 32 | |||
| 33 | __END__ | ||
| 34 | |||
| 35 | =pod | ||
| 36 | |||
| 37 | =encoding UTF-8 | ||
| 38 | |||
| 39 | =head1 NAME | ||
| 40 | |||
| 41 | Koha::Contrib::Tamil::Authority::Task - Base class for managing authorities manipulations | ||
| 42 | |||
| 43 | =head1 VERSION | ||
| 44 | |||
| 45 | version 0.072 | ||
| 46 | |||
| 47 | =head1 AUTHOR | ||
| 48 | |||
| 49 | Frédéric Demians <f.demians@tamil.fr> | ||
| 50 | |||
| 51 | =head1 COPYRIGHT AND LICENSE | ||
| 52 | |||
| 53 | This software is Copyright (c) 2023 by Fréderic Démians. | ||
| 54 | |||
| 55 | This is free software, licensed under: | ||
| 56 | |||
| 57 | The GNU General Public License, Version 3, June 2007 | ||
| 58 | |||
| 59 | =cut |