Skip to content

Instantly share code, notes, and snippets.

@tuxido-feynman
Created February 26, 2013 05:16
Show Gist options
  • Save tuxido-feynman/5036094 to your computer and use it in GitHub Desktop.
Save tuxido-feynman/5036094 to your computer and use it in GitHub Desktop.
Ruby Singleton... not that exciting
#Singleton class for interview practice
require 'singleton'
class InterviewSingleton
include Singleton
def iterate
@iterator ? @iterator += 1 : @iterator = 0
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment