Module: GoodJob::Callable

Defined in:
lib/good_job/callable.rb

Overview

An object that has case-equality to a Proc or Lambda by responding to #call. This can be used to duck-type match in a case statement.

Class Method Summary collapse

Class Method Details

.===(other) ⇒ Object

Whether the object responds to #call



8
9
10
# File 'lib/good_job/callable.rb', line 8

def self.===(other)
  other.respond_to?(:call)
end