0

Hash value like method

i have var = {a: "method_a", b: "method_b"} def code(name) var[name] end def method_a puts "AAA" end ... how to call method from hash(value) ?

10th Sep 2017, 9:44 AM
erikable
erikable - avatar
1 ответ
0
done var = {:a => "method_a", :b => "method_b"} def method_a puts "hhhhhhhh" end d = var[:a] send d
10th Sep 2017, 11:36 AM
erikable
erikable - avatar