ruby hash with self referencing elements / recursive hash -
I want a ruby hash with key: a ,: b ,: c because that is HK: [B] = H [: A] + 1; H [: c] = h [: b] + 2 etc.
How can I define such a hash in a line declaration like H = {: A => 1,: B => H [: A] + 1 ,: c => H [: B] +2, ...}?
Property: Path, FilePath
Property: md5sum, string ,: default => lambda {| R, p | Digest :: MD5.hexdigest (r.path.read)}
Where: md5sum default value is referenced: path property
Comments
Post a Comment