data/TWiki/ObjectMethod.txt
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
permissions -rw-r--r--
RELEASE 4.2.0 freetown
colas@0
     1
%META:TOPICINFO{author="TWikiContributor" date="1111929255" format="1.0" version="2"}%
colas@0
     2
An ObjectMethod is a method that must be called relative to a previous constructed object of the class type. For example:
colas@0
     3
colas@0
     4
---+ package Telecoms
colas@0
     5
---++ ClassMethod new()
colas@0
     6
---++ ObjectMethod phone( $who )
colas@0
     7
colas@0
     8
must be called something like this
colas@0
     9
colas@0
    10
<verbatim>
colas@0
    11
my $mobile = new Telecoms();
colas@0
    12
$mobile->phone( "home" );
colas@0
    13
</verbatim>
colas@0
    14
or you can pass the object in as a parameter if you need to:
colas@0
    15
<verbatim>
colas@0
    16
Telecoms::phone( $mobile, "home" );
colas@0
    17
</verbatim>
colas@0
    18
colas@0
    19
__Related Topics:__ ClassMethod, StaticMethod, DeveloperDocumentationCategory
colas@0
    20