From 934a22a1616d5c2ec44dc7944892dba9ce7944a1 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Tue, 7 Aug 2012 10:25:38 -0400 Subject: [PATCH] Bug 7417 follow-up: use Moose-like syntax for accessors Content-Type: text/plain; charset="UTF-8" In order to make the Koha codebase more consistent, this patch switches the RecordProcessor code to use the Moose-like syntax supported by Class::Accessor. --- Koha/RecordProcessor.pm | 8 +++++--- Koha/RecordProcessor/Base.pm | 10 +++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Koha/RecordProcessor.pm b/Koha/RecordProcessor.pm index 96ade9a..dcee39c 100644 --- a/Koha/RecordProcessor.pm +++ b/Koha/RecordProcessor.pm @@ -58,12 +58,14 @@ clone it I to passing it off to the RecordProcessor. =cut use Modern::Perl; +use Class::Accessor "antlers"; use Module::Load::Conditional qw(can_load); use Module::Pluggable::Object; -use base qw(Class::Accessor); - -__PACKAGE__->mk_accessors(qw( schema filters options record )); +has schema => ( is => "rw" ); +has filters => ( is => "rw" ); +has options => ( is => "rw" ); +has record => ( is => "rw" ); =head2 new diff --git a/Koha/RecordProcessor/Base.pm b/Koha/RecordProcessor/Base.pm index e051b74..52a541b 100644 --- a/Koha/RecordProcessor/Base.pm +++ b/Koha/RecordProcessor/Base.pm @@ -59,11 +59,12 @@ clone it I to passing it off to the RecordProcessor. =cut use Modern::Perl; +use Class::Accessor "antlers"; -use base qw(Class::Accessor); +has name => ( is => "ro" ); +has version => ( is => "ro" ); +has params => ( is => "rw" ); -__PACKAGE__->mk_ro_accessors(qw( name version )); -__PACKAGE__->mk_accessors(qw( params )); our $NAME = 'Base'; our $VERSION = '1.0'; @@ -78,8 +79,7 @@ Create a new filter; sub new { my $class = shift; - my $self = $class->SUPER::new( { });#name => $class->NAME, - #version => $class->VERSION }); + my $self = $class->SUPER::new( { }); bless $self, $class; return $self; -- 1.7.2.5