So this one was a surprise to me today, filed in the shoulda-known folder.
Straight from the rdoc:
h = {'foo' => 'bar', 'baz' => 'bat'}
'food'.sub('foo', h)
# => "bard"It doesn't work if the hash keys are symbols though.
So this one was a surprise to me today, filed in the shoulda-known folder.
Straight from the rdoc:
h = {'foo' => 'bar', 'baz' => 'bat'}
'food'.sub('foo', h)
# => "bard"It doesn't work if the hash keys are symbols though.