Sha256: f6052941c04e8549cd225b1d9c9c71c054383ac75a4d6f67182d31262e1926f4

Contents?: true

Size: 281 Bytes

Versions: 3

Compression:

Stored size: 281 Bytes

Contents

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

    def call(*args, &block)
      if context
        context.instance_exec(*args, &block)
      else
        block.call(*args, &block)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
muack-1.6.0 lib/muack/block_26.rb
muack-1.5.1 lib/muack/block_26.rb
muack-1.5.0 lib/muack/block_26.rb