From: Dave Thomas Date: 2001-12-24T01:28:04+09:00 Subject: [ruby-talk:29367] Re: a better way? nobu.nokada@softhome.net writes: > module Temp > @farenheit = Hash.new do |h, c| > h[c] = c * 9 / 5 + 32 > end > class << self > attr_reader :farenheit > end > end > > Temp.farenheit[100] # => 212 > Temp.farenheit[200] # => 392 That is going on my list of FAQ additions. Not that anyone's asked the question more than once, but it is just too neat. Dave