Skip to content

Instantly share code, notes, and snippets.

@asmallteapot
Created September 20, 2012 18:00
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asmallteapot/3757396 to your computer and use it in GitHub Desktop.
Save asmallteapot/3757396 to your computer and use it in GitHub Desktop.
Singletons in RubyMotion 1.4
# http://blog.rubymotion.com/post/31917526853/rubymotion-gets-ios-6-iphone-5-debugger
class STSomeAPIClient
def self.sharedClient
Dispatch.once { @instance ||= new }
@instance
end
end
@davidcunha
Copy link

Thanks!

@Cosmo
Copy link

Cosmo commented Aug 17, 2014

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment