| Class-Classgen-classgen documentation | Contained in the Class-Classgen-classgen distribution. |
Dog - just another Creature (Creature::Dog) (/examples).
This dog will just think(), besides what an ordinary creature does.
Name: Michael Schlueter
email: mschlue@cpan.org
Copyright (c) 2000, <your name here>. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
| Class-Classgen-classgen documentation | Contained in the Class-Classgen-classgen distribution. |
# --- Generated by classgen 3.0 on Son Apr 2 17:53:08 MEST 2000 --- package Dog; use Creature; @ISA=( "Creature" ); ; sub new { my $self = shift; my $type = ref($self)||$self; # instance-variables: my $a; #justadummy $self=bless { _a => $a, }, $type; $self->inherit_from($self->Creature::new()); # adapt when inheriting return $self; } # --- methods specific for this class --------------------- sub specific { my ($self) = @_; } sub think { my ($self, $text) = @_; $self->make_noise( "{".$text."}" ); } # --- inheritance methode ----------------------------------- sub inherit_from { my ($self, $base_blessed) = @_; my @l = keys %$base_blessed; foreach (@l) { $self->{$_} = $base_blessed->{$_}; } } # --- accessor methods ----------------------------------- sub get_a { my ($self) = @_; $self->{_a}; } # --- manipulator methods -------------------------------- sub clear_a { my ($self) = @_; my $v = $self->set_a(undef); } sub set_a { my ($self, $value) = @_; $self->{_a} = $value; } 1; __END__