Skip to content

Instantly share code, notes, and snippets.

@robmint
Last active May 9, 2016 01:38
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 robmint/f13c890d688ed0b5a34fda9ce1985ef4 to your computer and use it in GitHub Desktop.
Save robmint/f13c890d688ed0b5a34fda9ce1985ef4 to your computer and use it in GitHub Desktop.
ruby singleton pattern
require 'yaml'
module Valet
class Messages
@messages ||= YAML::load_file(File.expand_path('../../../messages.yml', __FILE__))
def self.text(key)
@messages[key]['text']
end
def self.url(key)
@messages[key]['url']
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment