Sha256: 53be0f367417428e8b24fc8368cb721b30c0e95448ad8b6fc61e87b8dca22842

Contents?: true

Size: 555 Bytes

Versions: 2

Compression:

Stored size: 555 Bytes

Contents

# frozen_string_literal: true

module Phlex::Rails::UnbufferedOverrides
	def method_missing(name, *args, **kwargs, &block)
		if @object.respond_to?(name)

			__class__.define_method(name) do |*a, **k, &b|
				@object.capture do
					if b
						@object.public_send(name, *a, **k) do |*aa|
							@object.helpers.capture(*aa, &b)
						end
					else
						@object.public_send(name, *a, **k)
					end
				end
			end

			# Now we've defined this missing method, we can call it.
			__public_send__(name, *args, **kwargs, &block)
		else
			super
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
phlex-rails-0.9.0 lib/phlex/rails/unbuffered_overrides.rb
phlex-rails-0.8.0 lib/phlex/rails/unbuffered_overrides.rb