Posted By

iloveitaly on 11/02/11


Tagged

ruby Singleton macruby


Versions (?)

Singleton Pattern MacRuby


 / Published in: Ruby
 

Works fine for MacRuby applications

  1. class NewClass
  2. @@sharedController = nil
  3. def self.sharedController
  4. @@sharedController
  5. end
  6.  
  7. def initialize
  8. @@sharedController = self
  9. end
  10. end

Report this snippet  

You need to login to post a comment.