Files
news.gitea.happylizard.me/bin/gems/hashery-2.1.2/demo/03_casting_hash.rdoc
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

13 lines
260 B
Plaintext

= CastingHash
A CastingHash is a Hash that allows _casting_ procedures to
defined that the keys and values pass through upon assignment.
c = CastingHash.new
c.cast_proc = lambda { |k,v| [k.to_s, v.to_s.upcase] }
c[:a] = 'a'
c.assert == {'a'=>'A'}