Package::Transporter::Generator::Potential::Get_Set_Methods - Automatically created accessors and mutators


Package-Transporter documentation  | view source Contained in the Package-Transporter distribution.

Index


NAME

Top

Package::Transporter::Generator::Potential::Get_Set_Methods - Automatically created accessors and mutators

SYNOPSIS

Top

	use Package::Transporter sub{eval shift}, sub {
		$_[0]->register_drain('::Random', 'FOR_SELF',
			'ATB_', qw(WORLD));
		$_[0]->register_potential('::Get_Set_Methods', 'FOR_ANY');
	};

	my $obj = bless( {}, 'main');
	$obj->set_world(1); # $obj->{+ATB_WORLD} = 1

	use Data::Dumper;
	print STDERR Dumper($obj);

	exit(0);

DESCRIPTION

Top

The above example enables accessors and mutators for objects globally. The random keys for the hash are really nice, aren't they?!

Objects via Arrays

The same example for objects implemented via arrays.

	use Package::Transporter sub{eval shift}, sub {
		$_[0]->register_drain('::Enumerated', 'FOR_SELF',
			'ATB_', qw(WORLD));
		$_[0]->register_potential('::Get_Set_Methods', 'FOR_ANY');
	};

	my $obj = bless( [], 'main');
	$obj->set_world(1); # $obj->[ATB_WORLD] = 1

	use Data::Dumper;
	print STDERR Dumper($obj);

	exit(0);

ANYTHING ELSE

Top

Please see the documentation of the upstream package Package::Transporter.


Package-Transporter documentation  | view source Contained in the Package-Transporter distribution.