Quantcast
Channel: 懒得折腾
Viewing all articles
Browse latest Browse all 764

Send method in Ruby

$
0
0
x = [1,2,3]
x.send :[]=,0,2
x[0] + x.[](1) + x.send(:[],2)


x = [1, 2, 3]
x[0] = 2
x[0] + x[1] + x[2]


Viewing all articles
Browse latest Browse all 764

Trending Articles