From: Karl Date: 2010-03-03T01:00:25+09:00 Subject: Compute value inside define_method I know there is a 'trick' for forcing a value to compute, but I can't seem to remember or find it. The following routine needs to computer the value of 'register += 1' and not insert it literally. into.class_eval do define_method "#{dow}_#{tod}_time" do @registers.get_value( "#{register += 1}".to_i ) end ...snip... end You can see my attempt above, but it doesn't work. Neither does 'eval("register += 1")' What's the trick? or should I approach the problem from a different angle?