Skip to content

Instantly share code, notes, and snippets.

@rebx
Created August 6, 2013 06:24
Show Gist options
  • Save rebx/6162494 to your computer and use it in GitHub Desktop.
Save rebx/6162494 to your computer and use it in GitHub Desktop.
def self.initialize(opts)
opts.each do |k,v|
instance_variable_set("@#{k}",v)
eigenclass = class<<self; self; end
eigenclass.class_eval do
attr_accessor k
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment