Module: Xot::BlockUtil

Extended by:
BlockUtil
Included in:
BlockUtil
Defined in:
lib/xot/block_util.rb

Instance Method Summary collapse

Instance Method Details

#instance_eval_or_block_call(recv, *args, &block) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/xot/block_util.rb', line 9

def instance_eval_or_block_call (recv, *args, &block)
  if block.arity == 0
    recv.instance_eval &block
  else
    block.call recv, *args
  end
end