Module: JunkDrawer::Callable

Included in:
Notifier, Notifier::HoneybadgerStrategy, Notifier::NullStrategy, Notifier::RaiseStrategy
Defined in:
lib/junk_drawer/callable.rb

Overview

module to constrain interfaces of classes to just ‘call`

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



48
49
50
# File 'lib/junk_drawer/callable.rb', line 48

def self.included(base)
  base.public_send(:extend, ClassMethods)
end

Instance Method Details

#callObject

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/junk_drawer/callable.rb', line 12

def call
  raise NotImplementedError
end

#to_procObject



16
17
18
# File 'lib/junk_drawer/callable.rb', line 16

def to_proc
  proc { |args| self.(*args) }
end