309 shaares
162 liens privés
162 liens privés
2 résultats
taggé
string
a = %[Now this is a string "#{ 1+1 }" or even with 'simple' quotes]
=> "Now this is a string \"2\" or even with 'simple' quotes"
SO usefull, why did I not know that before ?
class String
def to_proc
eval "Proc.new { |*args| args.first#{self} }"
end
end
You can, but should you ?