Sha256: 191ae38b6ca28496bee9a0f7382b4a691ccb127c4e5149c326b07f5c3371be58

Contents?: true

Size: 253 Bytes

Versions: 4

Compression:

Stored size: 253 Bytes

Contents

# frozen_string_literal: true

module Phlex
	class Block
		include Callable

		def initialize(context, &block)
			@context = context
			@block = block
		end

		def call(*args, **kwargs)
			@context.instance_exec(*args, **kwargs, &@block)
		end
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
phlex-0.5.3 lib/phlex/block.rb
phlex-0.5.2 lib/phlex/block.rb
phlex-0.5.1 lib/phlex/block.rb
phlex-0.5.0 lib/phlex/block.rb