Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Class::Tiny::Chained(3User Contributed Perl DocumentatiClass::Tiny::Chained(3)

NAME
       Class::Tiny::Chained - Minimalist class construction, with chained
       attributes

SYNOPSIS
       In Person.pm:

	package	Person;

	use Class::Tiny::Chained qw( name );

	1;

       In Employee.pm:

	package	Employee;
	use parent 'Person';

	use Class::Tiny::Chained qw( ssn ), {
	  timestamp => sub { time }    # attribute with	default
	};

	1;

       In example.pl:

	use Employee;

	my $obj	= Employee->new( name => "Larry", ssn => "111-22-3333" );

	# attribute setters are	chainable
	my $obj	= Employee->new->name("Fred")->ssn("444-55-6666");
	my $ts = $obj->name("Bob")->timestamp;

DESCRIPTION
       Class::Tiny::Chained is a wrapper around	Class::Tiny which makes	the
       generated attribute accessors chainable;	that is, when setting an
       attribute value,	the object is returned so that further methods can be
       called.

BUGS
       Report any issues on the	public bugtracker.

AUTHOR
       Dan Book	<dbook@cpan.org>

COPYRIGHT AND LICENSE
       This software is	Copyright (c) 2015 by Dan Book.

       This is free software, licensed under:

	 The Artistic License 2.0 (GPL Compatible)

SEE ALSO
       Object::Tap, MooX::ChainedAttributes

perl v5.32.0			  2016-09-16	       Class::Tiny::Chained(3)

NAME | SYNOPSIS | DESCRIPTION | BUGS | AUTHOR | COPYRIGHT AND LICENSE | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Class::Tiny::Chained&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help