Sha256: 30bca1793a5f57db126c8816a2b930e8d9ffb35cd77b7ab5844f74ac827ba28a
Contents?: true
Size: 747 Bytes
Versions: 19
Compression:
Stored size: 747 Bytes
Contents
# frozen_string_literal: true module Ruby2html module ComponentHelper def html(&block) previous_renderer = __ruby2html_renderer__ Ruby2html::Render.new(self, &block).yield_self do |component_renderer| Thread.current[:__ruby2html_renderer__] = component_renderer component_renderer.render.html_safe end ensure Thread.current[:__ruby2html_renderer__] = previous_renderer end def method_missing(method, *args, **options, &block) if __ruby2html_renderer__.respond_to?(method) __ruby2html_renderer__.send(method, *args, **options, &block) else super end end def __ruby2html_renderer__ Thread.current[:__ruby2html_renderer__] end end end
Version data entries
19 entries across 19 versions & 1 rubygems