Skip to content

Instantly share code, notes, and snippets.

@ColinDKelley
Created March 13, 2014 00:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ColinDKelley/9519868 to your computer and use it in GitHub Desktop.
Save ColinDKelley/9519868 to your computer and use it in GitHub Desktop.
modified_singleton-example.rb
class Secrets
def initialize(secrets_path)
@hash = YAML.load_file(secrets_path)
end
def [](key)
@hash[key]
end
def set_instance
self.class.set_instance(self)
end
...
class << self
attr_accessor :instance
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment