Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created March 3, 2012 14:52
Show Gist options
  • Save jnthn/1966516 to your computer and use it in GitHub Desktop.
Save jnthn/1966516 to your computer and use it in GitHub Desktop.
module Describe;
sub describe(::T) is export {
join "\n", gather {
take "Type {T.^name}";
take " Attributes:";
for T.^attributes(:local) -> $attr {
take " $attr.name() ({
$attr.has_accessor ?? 'public' !! 'private'
})";
}
take " Methods:";
for T.^methods(:local).sort(*.name) -> $meth {
take " $meth.name()";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment