Sha256: 184251c1fe470ac5ba8e2a0a4984b639a669264fc1c306019ebdb0b276d1d7e7

Contents?: true

Size: 303 Bytes

Versions: 7

Compression:

Stored size: 303 Bytes

Contents

# -*- coding: utf-8 -*-


module Xot


  module BlockUtil

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

    extend self

  end# BlockUtil


end# Xot

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
xot-0.1.34 lib/xot/block_util.rb
xot-0.1.33 lib/xot/block_util.rb
xot-0.1.32 lib/xot/block_util.rb
xot-0.1.31 lib/xot/block_util.rb
xot-0.1.30 lib/xot/block_util.rb
xot-0.1.29 lib/xot/block_util.rb
xot-0.1.28 lib/xot/block_util.rb