refactor sketchup-ruby code

J

Jim

Hello,

I need help in understanding how I can factor out some code I posted
here:

http://sites.google.com/site/jimfoltz/other-stuff

I'm a novice but I am experimenting with sketchup observers, and the
code near the top has a lot redundancy.

The first thing I want to understand is how I can factor out this
section:

{|m| self.class.send:)define_method, m) {|*a| @c+= 1;puts "#{@c}:#{m}:#
{ a.inspect }" } }

so it only needs edited in a single place, instead of once for each
observer.

Thanks. Any other constructive comments are appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top