Index index by Group index by Distribution index by Vendor index by creation date index by Name Mirrors Help Search

perl-Class-Accessor-0.51-1.14 RPM for noarch

From OpenSuSE Tumbleweed for noarch

Name: perl-Class-Accessor Distribution: openSUSE Tumbleweed
Version: 0.51 Vendor: openSUSE
Release: 1.14 Build date: Sun Sep 26 00:38:36 2021
Group: Development/Libraries/Perl Build host: lamb06
Size: 42491 Source RPM: perl-Class-Accessor-0.51-1.14.src.rpm
Packager: https://bugs.opensuse.org
Url: http://search.cpan.org/dist/Class-Accessor/
Summary: Automated accessor generation
This module automagically generates accessors/mutators for your class.

Most of the time, writing accessors is an exercise in cutting and pasting.
You usually wind up with a series of methods like this:

    sub name {
        my $self = shift;
        if(@_) {
            $self->{name} = $_[0];
        }
        return $self->{name};
    }

    sub salary {
        my $self = shift;
        if(@_) {
            $self->{salary} = $_[0];
        }
        return $self->{salary};
    }

  

One for each piece of data in your object. While some will be unique, doing
value checks and special storage tricks, most will simply be exercises in
repetition. Not only is it Bad Style to have a bunch of repetitious code,
but it's also simply not lazy, which is the real tragedy.

If you make your module a subclass of Class::Accessor and declare your
accessor fields with mk_accessors() then you'll find yourself with a set of
automatically generated accessors which can even be customized!

The basic set up is very simple:

    package Foo;
    use base qw(Class::Accessor);
    Foo->mk_accessors( qw(far bar car) );

Done. Foo now has simple far(), bar() and car() accessors defined.

Alternatively, if you want to follow Damian's _best practice_ guidelines
you can use:

    package Foo;
    use base qw(Class::Accessor);
    Foo->follow_best_practice;
    Foo->mk_accessors( qw(far bar car) );

*Note:* you must call 'follow_best_practice' before calling 'mk_accessors'.

Provides

Requires

License

Artistic-1.0 or GPL-1.0+

Changelog

* Mon Oct 23 2017 coolo@suse.com
  - updated to 0.51
    see /usr/share/doc/packages/perl-Class-Accessor/Changes
    0.50 2017-10-20
      Thanks to Jonas B. Nielsen for working through the RT queue.
    - patch for speed increase RT#84838
    - patch for faster constructor RT#57353
    - fixed typos for RT#61304 and RT#86422
* Fri Nov 18 2011 coolo@suse.com
  - use original .tar.gz
* Mon Aug 22 2011 lars@linux-schulserver.de
  - enhance the description
  - also package examples directory
* Tue Nov 30 2010 coolo@novell.com
  - switch to perl_requires macro
* Mon Mar 08 2010 chris@computersalat.de
  - cleanup spec
    o dep for perl-macros
    o Provides
    o Makefile.PL
* Wed Jan 13 2010 anicka@suse.cz
  - update to 0.34
    * add a Moose-like interface: I can haz "has"
* Sun Jan 10 2010 jengelh@medozas.de
  - enable parallel build
* Sat Jul 25 2009 chris@computersalat.de
  - spec mods
    * removed ^----------
    * removed ^#---------
* Sun Jun 28 2009 chris@computersalat.de
  - added perl-macros
    o autogen filelist with perl_gen_filelist
  - spec mods
    o fixed deps
      no usage of Carp::Assert since 0.15
* Mon May 18 2009 anicka@suse.cz
  - update to 0.33
    * small cleanups to fix RT#45592 and RT#43493

Files

/usr/lib/perl5/vendor_perl/5.34.0/Class
/usr/lib/perl5/vendor_perl/5.34.0/Class/Accessor
/usr/lib/perl5/vendor_perl/5.34.0/Class/Accessor.pm
/usr/lib/perl5/vendor_perl/5.34.0/Class/Accessor/Fast.pm
/usr/lib/perl5/vendor_perl/5.34.0/Class/Accessor/Faster.pm
/usr/share/doc/packages/perl-Class-Accessor
/usr/share/doc/packages/perl-Class-Accessor/Changes
/usr/share/doc/packages/perl-Class-Accessor/README
/usr/share/doc/packages/perl-Class-Accessor/examples
/usr/share/doc/packages/perl-Class-Accessor/examples/benchmark
/usr/share/man/man3/Class::Accessor.3pm.gz
/usr/share/man/man3/Class::Accessor::Fast.3pm.gz
/usr/share/man/man3/Class::Accessor::Faster.3pm.gz


Generated by rpm2html 1.8.1

Fabrice Bellet, Mon Oct 18 23:27:06 2021