~kosova/+junk/tuxfamily-twiki

« back to all changes in this revision

Viewing changes to foswiki/data/System/ObjectMethod.txt

  • Committer: James Michael DuPont
  • Date: 2009-07-18 19:58:49 UTC
  • Revision ID: jamesmikedupont@gmail.com-20090718195849-vgbmaht2ys791uo2
added foswiki

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%META:TOPICINFO{author="ProjectContributor" date="1231502400" format="1.1" version="1"}%
 
2
An ObjectMethod is a method that must be called relative to a previous constructed object of the class type. For example:
 
3
 
 
4
---+ package Telecoms
 
5
---++ ClassMethod new()
 
6
---++ ObjectMethod phone( $who )
 
7
 
 
8
must be called something like this
 
9
 
 
10
<verbatim>
 
11
my $mobile = new Telecoms();
 
12
$mobile->phone( "home" );
 
13
</verbatim>
 
14
or you can pass the object in as a parameter if you need to:
 
15
<verbatim>
 
16
Telecoms::phone( $mobile, "home" );
 
17
</verbatim>
 
18
 
 
19
---
 
20
*Related Topics:* ClassMethod, StaticMethod
 
21