In role Metamodel::MethodContainer§
See primary documentation in context for method methods
method methods($obj, :$all, :$local)
Returns a list of public methods available on the class (which includes methods from superclasses and roles). By default this stops at the classes Cool
, Any
or Mu
; to really get all methods, use the :all
adverb. If :local
is set, only methods declared directly in the class are returned.
class A { method x() { }; } say A.^methods(); # x say A.^methods(:all); # x infinite defined ...
The returned list contains objects of type Method
, which you can use to introspect their signatures and call them.
Some introspection method-look-alikes like WHAT
will not show up, although they are present in any Raku object. They are handled at the grammar level and will likely remain so for bootstrap reasons.