• Login
sketchucation logo sketchucation
  • Login
๐Ÿ”Œ Quick Selection | Try Didier Bur's reworked classic extension that supercharges selections in SketchUp Download

How do we view methods, (And their Arguments) of a Class

Scheduled Pinned Locked Moved Developers' Forum
4 Posts 4 Posters 157 Views 4 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    Gruff
    last edited by 26 Oct 2009, 14:30

    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.

    Resistance is .... Character Forming. Grin

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 26 Oct 2009, 21:45

      componentInstance.methods

      TIG

      1 Reply Last reply Reply Quote 0
      • R Offline
        RunnerPack
        last edited by 27 Oct 2009, 01:40

        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).sort
        

        Which 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...

        You might have noticed... I'm a bit of a ferpectionist.

        1 Reply Last reply Reply Quote 0
        • C Offline
          Chris Fullmer
          last edited by 27 Oct 2009, 03:42

          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

          Lately you've been tan, suspicious for the winter.
          All my Plugins I've written

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            1/4
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement