Skip to content

Instantly share code, notes, and snippets.

@lisovskyvlad
Created March 30, 2013 18:11
Show Gist options
  • Save lisovskyvlad/5277725 to your computer and use it in GitHub Desktop.
Save lisovskyvlad/5277725 to your computer and use it in GitHub Desktop.
# encoding: UTF-8
require 'singleton'
class Cats
include Singleton
def initialize
@cat = { name: 'Alice', sex: 'F' }
end
def ask(msg)
puts msg
end
# def get_from_cat(key)
# @cat[key.to_sym]
# end
end
Cats.instance.ask('myaaaooo!')
# only hard coree!!
puts Cats.instance.instance_eval { @cat[:name] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment