On 19 January 2012 23:03, Christian MICHON <[email protected]>wrote: > > > > >> - I need to memoize in a class variable the columns list (I'm making a > >> custom checksum, excluding some columns and therefore I do not wish to > >> calculate at each checksum the list of columns to exclude). How to > >> insert this class variable inside the plugin ? > > > > Class variables are almost certainly the wrong approach. You probably > > want to use class instance variables (instances variables of the > > class). This is fairly easy to do by adding an attr_accessor in > > ClassMethods and calling that method on the class itself. > > > > I meant a @@ variable/attribute. I will update my code following your > suggestions tomorrow. >
There's an example of using class instance variables on this blog post: http://blog.codegram.com/2011/4/understanding-class-instance-variables-in-ruby Regards, Iain -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
