Class::Trait::Base(3pm)

Class::Trait::Base3pm

Base class for all traits

Usage

This class needs to be inherited by all traits so they can be identified as traits.

        use Class::Trait 'base';

Overview

Not much going on here, just an AUTOLOAD method to help properly dispatch calls to "SUPER::" and an "apply" method.

apply

  require TSomeTrait;
  TSomeTrait->apply($object);

This method allows you to apply a trait to an object. It returns the trait so you can then reapply it:

 TTricks->apply($dog_object)
        ->apply($cat_object);

This is merely syntactic sugar for the "Class::Trait::apply" method:

 Class::Trait->apply($dog_object, 'TTricks');
 Class::Trait->apply($cat_object, 'TTricks');

Maintainer

Curtis "Ovid" Poe, "<ovid [at] cpan [dot] org>"

Releases

7 releases since Debian 5.0 (Lenny); the text changed 3 times.

  1. 5.0
  2. 6.0–7
  3. 8–10
  4. 11

Author

Stevan Little <[email protected]>

From libclass-trait-perl 0.31-4.1 in Debian 11 (Bullseye). Parsed by carta from the page's man source.