Sha256: 106ba196ce25fda5a13e011ab4c3f17470c4fc14c7a440e5c75b19e2623a7f64

Contents?: true

Size: 251 Bytes

Versions: 4

Compression:

Stored size: 251 Bytes

Contents

module Muack
  class Block < Struct.new(:block, :context)
    def initialize block, context=nil
      super
    end

    def call(...)
      if context
        context.instance_exec(...)
      else
        block.call(...)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
muack-1.7.0 lib/muack/block.rb
muack-1.6.0 lib/muack/block_27.rb
muack-1.5.1 lib/muack/block_27.rb
muack-1.5.0 lib/muack/block_27.rb