Ruby/Method/send

Материал из Wiki.crossplatform.ru

Версия от 17:55, 13 сентября 2010; ViGOur (Обсуждение | вклад)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Built-In Reflection

my_string = "times"
3.send(my_string) { print "Hello "}



Calling Methods Dynamically

"this is a test".send(:length) # 13 
"this is a sub".send("sub", /iles/, ".")