Sha256: 2be8ecb5d7f39c059fac0a809389d70280de89d06aa8d65d954ba992b9829238
Contents?: true
Size: 1.24 KB
Versions: 22
Compression:
Stored size: 1.24 KB
Contents
class Card class Bootstrap # support html tag generation class TagMethod include Content def initialize component, name, html_class, tag_opts={}, &tag_block @component = component @name = name @html_class = html_class @tag_opts = tag_opts @tag_block = tag_block @append = [] @wrap = [] @xm = Builder::XmlMarkup.new end def call *_args, &content_block component.content.push "".html_safe opts = process_content(&content_block) process_collected_content tag_name, opts process_append "" end def method_missing method, *args, &block return super unless respond_to_missing? method @component.send method, *args, &block end def respond_to_missing? method, _include_private=false @component.respond_to? method end def prepend &block tmp = @content.pop instance_exec(&block) @content << tmp end def wrap &block instance_exec(&block) end def append &block @append[-1] << block end def wrapInner tag=nil, &block @wrap[-1] << (block_given? ? block : tag) end end end end
Version data entries
22 entries across 22 versions & 1 rubygems