Skip to content

Instantly share code, notes, and snippets.

@lunks
Created March 15, 2012 15:35
Show Gist options
  • Save lunks/2044825 to your computer and use it in GitHub Desktop.
Save lunks/2044825 to your computer and use it in GitHub Desktop.
module NewSession
class User
@users = Hash.new {|hash, key| hash[key] = User.new}
class << self
def find_or_create_user name
name = name.to_sym
@users[name]
end
end
def initialize
@sites = {}
end
def register_site site
site = site.to_sym
class << self
define_method site do
puts site
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment