Sha256: df6f0b4ac805005ce7775f4b7208b143a51c6e231a3ca6f07653a2af5513a7ad
Contents?: true
Size: 228 Bytes
Versions: 22
Compression:
Stored size: 228 Bytes
Contents
class String # Prepend an "@" to the beginning of a string # to make a instance variable name. This also replaces # non-valid characters with underscores. def variablize v = gsub(/\W/, '_') "@#{v}" end end
Version data entries
22 entries across 21 versions & 3 rubygems