Sha256: f3b012330020eadfcfed97799185504bfdfe733d9a1b2a304318a1bcc48bdb7e
Contents?: true
Size: 403 Bytes
Versions: 10
Compression:
Stored size: 403 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
10 entries across 10 versions & 1 rubygems