Sha256: c213811e30998472091aee65d073fd0dcba8afb4d9d44aebac68572c81201368
Contents?: true
Size: 405 Bytes
Versions: 7
Compression:
Stored size: 405 Bytes
Contents
class String # Interpolate. Provides a means of extenally using # Ruby string interpolation mechinism. # # try = "hello" # str = "\#{try}!!!" # String.interpolate{ str } #=> "hello!!!" # # NOTE: The block neccessary in order to get # then binding of the caller. # # CREDIT: Trans def self.interpolate(&str) eval "%{#{str.call}}", str.binding end end
Version data entries
7 entries across 7 versions & 2 rubygems