Files
news.gitea.happylizard.me/bin/gems/hashery-2.1.2/demo/02_query_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

18 lines
402 B
Plaintext

= QueryHash
A QueryHash is a Hash that provides open access much like an OpenHash, but it limits readers
to bang and query methods (i.e. method ending in `!` or `?`).
q = QueryHash.new
q.a = 1
q.b = 2
q.a?.assert == 1
q.b?.assert == 2
By default keys are converted to strings.
q.assert == { "a"=>1, "b"=>2 }
A QueryHash is compatible with Ruby's standard Hash in every other respect.