How do I use replace filters to add a method to a class named this.className
The class body is an array, where elements/nodes typically are MethodDefinition.
Do I use push or after or am I going in the wrong direction? Would be wonderful if there were examples in the docs beyond simple numbers in an Array but something more "real life"
Cheers!
How do I use replace filters to add a method to a class named
this.className
The class body is an array, where elements/nodes typically areMethodDefinition
. Do I usepush
orafter
or am I going in the wrong direction? Would be wonderful if there were examples in the docs beyond simple numbers in an Array but something more "real life" Cheers!The "problem" is that
.body
includes the scope brackets{ }
when inserted. I always seem to get this error when I try...Looking at append doesn't give me much of a clue :(
my attempts:
class Hello {{.body hello() { } }}
or do I append a String?
Can't make it work...