How do we view methods, (And their Arguments) of a Class
-
How do we view methods, (And their Arguments) of a Class in SketchUp?
To start with say a compiled class that is 'Required''.Instance_methods' doesn't seem to work like I would think it should.
-
componentInstance.methods
-
You can't show the arguments, but calling the '.methods' method on a class will list its methods and '.instance_methods' will give the same for an instance of it (i.e. an object); or you can just call ".methods" on an actual instance. To make it easier to understand, I usually to do something like:
puts (MysteryClass.methods - Object.methods).sortWhich lets you ignore the built-in methods inherited from the default parent class (including ".methods" itself
) and displays the result alphabetically.By "a compiled class that is 'Required'" I assume you mean a 3rd party (binary) extension. Is that right? If so, some info can be gleaned from the binary itself, but not much (if any) more than using ".methods" and the like.
You can look at it in a hex editor and usually see the names of classes, methods, etc. Under windows, I prefer this for snooping around

Well, I doubt if that helps, but there it is...
-
Thank you so much for that runnerpack. I really like how cleanly that outputs the methods. I've been trying to figure that out for a while. I think Jim or Todd showed me once, but I forgot where that thread was. I need to bookmark that line of code somewhere. It is quite lovely,
Chris
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement