I need a ruby hash H with keys :a, :b, :c so that H[:b] = H[:a] + 1; H[:c] = H[:b] + 2 etc.
How can I define such a hash in a one line declaration, like H = {:a=>1, :b => H[:a] + 1, :c => H[:b] +2, ... } ?
I need something similar to DataMapper properties declaration:
property :path, FilePath
property :md5sum, String, :default => lambda { |r, p| Digest::MD5.hexdigest(r.path.read)}
where :md5sum default value is referencing the :path property