How to use InspectMe directly from within a method?


#1

I can’t find any example of calling InspectMe for debugging from within a custom method: could someone provide an example?

let’s say i am calling an instance A , which calls method A.
In method A i want to use InspectMe.


#2

Hi @gquentin

Simple you can just use loops from InspectMe in you method, like this:

$evm.root.attributes.sort.each { |k, v| $evm.log("info", "  Attribute - #{k}: #{v}") }
$evm.root.associations.sort.each { |assc| $evm.log("info", "    Associations - #{assc}") }

In most cases this is enough.


#3

ok but i can’t call InspectMe directly?


#4

@gquentin

Like any other instances:

$evm.instantiate(’/System/Requests/InspectMe’)