Sha256: 19a12c5c58f14df2e18c10c18f4bd470a77b890ab6c8f0b10c39c215b2d50fc2

Contents?: true

Size: 270 Bytes

Versions: 27

Compression:

Stored size: 270 Bytes

Contents

# frozen_string_literal: true

module Phlex::Testing
	module ViewHelper
		def render(view, &block)
			if view.is_a?(Class) && view < Phlex::SGML
				view = view.new
			end

			view.call(view_context: view_context, &block)
		end

		def view_context
			nil
		end
	end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
phlex-1.11.0 lib/phlex/testing/view_helper.rb
phlex-1.10.3 lib/phlex/testing/view_helper.rb
phlex-1.9.3 lib/phlex/testing/view_helper.rb
phlex-1.10.2 lib/phlex/testing/view_helper.rb
phlex-1.4.2 lib/phlex/testing/view_helper.rb
phlex-1.5.3 lib/phlex/testing/view_helper.rb
phlex-1.6.3 lib/phlex/testing/view_helper.rb
phlex-1.7.2 lib/phlex/testing/view_helper.rb
phlex-1.8.3 lib/phlex/testing/view_helper.rb
phlex-1.9.2 lib/phlex/testing/view_helper.rb
phlex-1.10.1 lib/phlex/testing/view_helper.rb
phlex-1.10.0 lib/phlex/testing/view_helper.rb
phlex-1.4.1 lib/phlex/testing/view_helper.rb
phlex-1.5.2 lib/phlex/testing/view_helper.rb
phlex-1.6.2 lib/phlex/testing/view_helper.rb
phlex-1.7.1 lib/phlex/testing/view_helper.rb
phlex-1.8.2 lib/phlex/testing/view_helper.rb
phlex-1.9.1 lib/phlex/testing/view_helper.rb
phlex-1.9.0 lib/phlex/testing/view_helper.rb
phlex-1.8.1 lib/phlex/testing/view_helper.rb