summaryrefslogtreecommitdiffstats
path: root/test.pl
blob: ffc89a6db27f4f3c0ffbd1bc97f9f214b3cad4fe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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} };
}