Class: CatchBox::Hook::Factory

Inherits:
Object
  • Object
show all
Defined in:
lib/catch_box/hook/factory.rb

Instance Method Summary collapse

Instance Method Details

#call(pattern, hook) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/catch_box/hook/factory.rb', line 9

def call(pattern, hook)
  if pattern.nil?
    ::CatchBox::Hook::All.new(hook)
  else
    ::CatchBox::Hook::One.new(pattern, hook)
  end
end