Module: Gemmy::Patches::ProcPatch::InstanceMethods::Call

Defined in:
lib/gemmy/patches/proc_patch.rb

Instance Method Summary collapse

Instance Method Details

#call(*args, &blk) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/gemmy/patches/proc_patch.rb', line 7

def call(*args, &blk)
  this = self
  if (opts=args.last).is_a?(Hash) && (proc=opts[:threaded_if])
    if proc.is_a?(Proc) && proc.call
      return Thread.new { self.call(*args, &blk) }
    end
  end
  self.call(*args, &blk)
end