The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Data::Object::Class

ABSTRACT

Data-Object Class Declaration

SYNOPSIS

  package Person;

  use Data::Object::Class;

  extends 'Identity';

  1;

DESCRIPTION

This package modifies the consuming package making it a class.

INHERITANCE

This package inherits behaviors from:

Moo

INTEGRATIONS

This package integrates behaviors from:

Data::Object::ClassHas

LIBRARIES

This package uses type constraints defined by:

Data::Object::Library

KEYWORDS

This package provides the following keywords.

extends

  package Person;

  use Data::Object 'Class';

  extends 'Identity';

  1;

The extends keyword is used to declare superclasses your class will inherit from. See Moo for more information.

has

  package Person;

  use Data::Object 'Class';

  has fname => (
    is => 'ro',
    isa => 'Str'
  );

  has lname => (
    is => 'ro',
    isa => 'Str'
  );

  1;

The has keyword is used to declare class attributes, which can be accessed and assigned to using the built-in getter/setter or by the object constructor. See Moo for more information.

with

  package Person;

  use Data::Object 'Class';

  with 'Employable';

  1;

The with keyword is used to declare roles to be used and compose into your class. See Moo for more information.

CREDITS

Al Newkirk, +296

Anthony Brummett, +10

José Joaquín Atria, +1

AUTHOR

Al Newkirk, awncorp@cpan.org

LICENSE

Copyright (C) 2011-2019, Al Newkirk, et al.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

PROJECT

GitHub

Projects

Milestones

Contributing

Issues

SEE ALSO

To get the most out of this distribution, consider reading the following:

Do

Data::Object

Data::Object::Class

Data::Object::ClassHas

Data::Object::Role

Data::Object::RoleHas

Data::Object::Library