Sha256: 9a2e784f2d9f9b7d0907ce1ffefb20a2267ecbf2c364c5c536a19ca0d5a7fccb
Contents?: true
Size: 806 Bytes
Versions: 11
Compression:
Stored size: 806 Bytes
Contents
# frozen_string_literal: true # Include this module into an {HTML} or {SVG} component to make it yield the content block before calling {#template}. # @example # class Tabs < Phlex::HTML # include DeferredRender # # Tab = Data.define(:name, :content) # # def initialize # @tabs = [] # end # # def template # @tabs.each { |t| a { t.name } } # @tabs.each { |t| article(&t.content) } # end # # def tab(name, &content) # @tabs << Tab.new(name, content) # end # end module Phlex::DeferredRender # This module doesn't do anything. Phlex::HTML#call checks for its inclusion in the ancestry instead. # @!method template # @abstract Override to define your own template. # @note {DeferredRender} templates do not receive the content block. Instead, it is yielded in advance. end
Version data entries
11 entries across 11 versions & 1 rubygems