Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 73 lines (45 sloc) 1.693 kb

NAME

Perl 5 MOP - Meta Object Protocol - Attribute Sub Protocol

DESCRIPTION

This document will describe the proposed API for the attribute sub-protocol of the MOP.

Currently the attribute sub-protocol is very small, and it will likely stay this way. However, as has been found with Moose, this sub-protocol is an extremely powerful extension point.

API

The attribute sub-protocol is (at this stage) completely immutable. The reason being that we believe it is dangerous to allow the manipulation of attribute internals simply for the huge potential impact that could have. Instead you are encouraged to simply clone an attribute and change the values during the clone process.

AUTHORS NOTE: This is by no means a comprehensive list, nor is it a fixed list, of methods. This is simply the first draft of this.

General

get_name

This returns the name of the attribute as a string.

get_param_name

This returns the name of the attribute with the sigil stripped off.

get_initial_value

This returns the initial value (if any) that the attribute was given.

get_initial_value_for_instance

This returns a suitable copy of the initial value of the attribute to be used in instance construction.

clone( %params )

Clone this object and override any internal elements using the values in %params.

AUTHOR

Stevan Little <stevan.little@iinteractive.com>

COPYRIGHT AND LICENSE

Copyright 2011 Infinity Interactive, Inc.

http://www.iinteractive.com

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

Something went wrong with that request. Please try again.