From: Ezequiel Schwartzman Date: 2011-08-24T07:36:06+09:00 Subject: Static local variables for methods? I have this: def valid_attributes { :email => "some_#{rand(9999)}@thing.com" } end For Rspec testing right? But I would like to do something like this: def valid_attributes static user_id = 0 user_id += 1 { :email => "some_#{user_id}@thing.com" } end I don't want `user_id` to be accessible from anywhere but that method, is this possible with Ruby? -- Posted via http://www.ruby-forum.com/.