[SP-pm] test
Eden Cardim
eden at insoli.de
Tue Sep 11 21:05:50 PDT 2012
#+BEGIN_EXAMPLE
>>>>> "TG" == thiagoglauco-BWYn5i82JSrk1uMJSBkQmQ writes:
#+END_EXAMPLE
#+BEGIN_EXAMPLE
TG> Com Moose seu pacote Shapes ficaria assim:
#+END_EXAMPLE
#+begin_src perl
package Shapes;
use Moose;
has x => ( isa => "Int",
reader => "get_x",
writer => "set_x" );
has y => ( isa => "Int",
reader => "get_y",
writer => "set_y" );
sub moveTo {
my ($self, $deltax, $deltay) = @_;
$self->set_x( $self->get_x + $deltax );
$self->set_y( $self->get_y + $deltay );
}
1;
#+end_src
* eu faria assim:
#+begin_src perl
package Shapes;
use Moose;
has x => ( isa => "Int",
reader => "get_x",
writer => "set_x" );
has y => ( isa => "Int",
reader => "get_y",
writer => "set_y" );
sub moveTo {
my ($self, $deltax, $deltay) = @_;
$self->set_x( $self->get_x + $deltax );
$self->set_y( $self->get_y + $deltay );
}
1;
#+end_src
-------------- Pr?xima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://mail.pm.org/pipermail/saopaulo-pm/attachments/20120912/b3fac870/attachment.html>
More information about the SaoPaulo-pm
mailing list