Skip to content

Instantly share code, notes, and snippets.

@carols10cents
Created October 2, 2010 15:21
Show Gist options
  • Save carols10cents/607716 to your computer and use it in GitHub Desktop.
Save carols10cents/607716 to your computer and use it in GitHub Desktop.
class TestTwo
def initialize
@hash = Hash.new
end
def self.attr_accessor(arg)
define_method("get_#{arg}") do
@hash[arg]
end
define_method("set_#{arg}") do |v|
@hash[arg] = v
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment