method can
1 | class Metamodel::ClassHOW |
1.1 | (Metamodel::ClassHOW) method can |
2 | role Metamodel::MROBasedMethodDispatch |
2.1 | (Metamodel::MROBasedMethodDispatch) method can |
Documentation for method can
assembled from the following types:
class Metamodel::ClassHOW
From Metamodel::ClassHOW
(Metamodel::ClassHOW) method can
method can(Metamodel::ClassHOW: , )
Given a method name, it returns a List of methods that are available with this name.
;is A ;say B.^can('x').elems; # OUTPUT: «2»for B.^can('x')
In this example, class B
has two possible methods available with name x
(though a normal method call would only invoke the one installed in B
directly). The one in B
has arity 1 (i.e. it expects one argument, the invocant (self
)), and the one in A
expects 2 arguments (self
and $a
).
role Metamodel::MROBasedMethodDispatch
From Metamodel::MROBasedMethodDispatch
(Metamodel::MROBasedMethodDispatch) method can
method can(, )
Returns the list of methods of that name the object can do.