Ruby - Blocks, Procs, and Lambdas
Which of the following is the correct syntax to get a Method object for the method
greet on object person?greet on object person?methodmethod method expects a symbol representing the method name.:greet, which is correct. person.send(:greet) calls the method directly, returning its result instead of a Method object. person.method(greet) passes an undefined variable greet, causing error. person.method[b greet] uses brackets, which is invalid syntax.method [OK]:greet inside method() [OK]method() with send()15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions