From ad0d81e4fe287f6eaa14fb6665a0b47c85ef2564 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 13 Oct 2009 14:31:18 -0500 Subject: [PATCH] documentation adjustments --- lib/WebGUI/Definition.pm | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/lib/WebGUI/Definition.pm b/lib/WebGUI/Definition.pm index cdb70ce61..be3eac11c 100644 --- a/lib/WebGUI/Definition.pm +++ b/lib/WebGUI/Definition.pm @@ -178,16 +178,24 @@ WebGUI::Definition - Define properties for a class use WebGUI::Definition ( name => 'My Class', properties => [ - 'classProperty' => { + 'myProperty' => { label => "Class Property", }, ], ); my $object = MyClass->instantiate; + + # property list $object->getProperties; - $object->getProperty('classProperty'); + + # property attributes + $object->getProperty('myProperty'); + + # attribute value $object->getAttribute('name'); - $object->classProperty('value'); + + # generated accessor + $object->myProperty('value'); =head1 DESCRIPTION @@ -225,13 +233,22 @@ Returns a list of all of the properties for the class. Returns the attributes for the given property. -=head2 get +=head2 get ( [ $property ] ) -=head2 set +Retrieves the value of the given property. If no property is +specified, returns all of the properties as a hash reference. -=head2 update +=head2 set ( $properties ) -=head2 instantiate +Accepts a hash reference and sets all of the given properties. + +=head2 update ( $properties ) + +Sets properties just as L does, then calls the C method if it is available in the class. + +=head2 instantiate ( $properties ) + +Creates a new object instance, setting the given properties. =head2 $property