diff options
author | doy <doy@tozt.net> | 2009-05-01 18:30:51 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2009-05-01 18:30:51 -0500 |
commit | cac367cb01519969fda3a43c217dfbb009a1f358 (patch) | |
tree | 6106b196475a67955bce395ff07383c2ae6cdd41 | |
parent | 532eee2d51259330856ae6e866c756d6b1e678de (diff) | |
download | class-info-master.tar.gz class-info-master.zip |
-rw-r--r-- | test.pl | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -0,0 +1,24 @@ +#!/usr/bin/perl +use strict; +use warnings; + +use Class::Info; +my $info = Class::Info->new('NetHack::Item::Potion'); +my $methods = $info->classify_methods; +print "Local methods:\n"; +print " " . $_->as_string . "\n" for @{ $methods->{local} }; +print "Role methods:\n"; +my $role_methods = $methods->{composed}; +for my $role (keys %$role_methods) { + print " " . $_->as_string . "\n" for @{ $role_methods->{$role} }; +} +print "Inherited methods:\n"; +my $inherited_methods = $methods->{inherited}; +for my $inherit (keys %$inherited_methods) { + print " " . $_->as_string . "\n" for @{ $inherited_methods->{$inherit} }; +} +print "Imported methods:\n"; +my $imports = $methods->{imports}; +for my $import (keys %$imports) { + print " " . $_->as_string . "\n" for @{ $imports->{$import} }; +} |