method

__send__

Importance_1
v1_8_6_287 - Show latest stable - 0 notes - Class: Object
__send__(...) public

Invokes the method identified by symbol, passing it any arguments specified. You can use __send__ if the name send clashes with an existing method in obj.

   class Klass
     def hello(*args)
       "Hello " + args.join(' ')
     end
   end
   k = Klass.new
   k.send :hello, "gentle", "readers"   #=> "Hello gentle readers"
Show source
Register or log in to add new notes.