@tekin's Twitter archive

source code
Ruby trick: defining a template string as a format specification that you can interpolate named arguments into:

TEMPLATE = "Say %<greeting>s to %<name>s"
puts TEMPLATE % { greeting: "Hi", name: "Bob" }

The String#% method being a neater way of calling Kernel#sprintf
0
1