uses Method objects. : call « Method « Ruby






uses Method objects.


trane = "this is a test".method(:length) 
miles = "this is a sub".method("sub") 


trane.call # 13 
miles.call(/iles/, '.') 

 








Related examples in the same category