sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    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

      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
      • TIGT Offline
        TIG Moderator
        last edited by

        componentInstance.methods

        TIG

        1 Reply Last reply Reply Quote 0
        • RunnerPackR Offline
          RunnerPack
          last edited by

          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
          • Chris FullmerC Offline
            Chris Fullmer
            last edited by

            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
            • First post
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement