method

===

Importance_1
v2_6_3 - Show latest stable - 0 notes - Class: Method
===(*args) public

Invokes the method with obj as the parameter like #call. This allows a method object to be the target of a when clause in a case statement.

require 'prime'

case 1373
when Prime.method(:prime?)
  # ...
end
Show source
Register or log in to add new notes.