Sha256: 9e4eb54f4644a711e67a34c7c7643fb2ec8af9792b2b52e670b75d33e33642c1
Contents?: true
Size: 935 Bytes
Versions: 3
Compression:
Stored size: 935 Bytes
Contents
module Garterbelt class ContentTag < ClosedTag include ContentRendering def initialize(opts, &block) super if block_given? self.content = block else self.content = opts[:content] end end def id(identifier, &block) super(identifier) self.content = block if block_given? self end def c(*classes, &block) super(*classes) self.content = block if block_given? self end def head_template style == :text ? '' : "#{indent}<#{type}#{rendered_attributes}>#{line_end}" end def head self.output << head_template super end def foot_template if style == :text [:p, :ul, :ol, :li].include?(type) ? "\n" : '' else "#{indent}</#{type}>#{line_end}" end end def foot super self.output << foot_template end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
garterbelt-0.1.0 | lib/renderers/content_tag.rb |
garterbelt-0.0.9 | lib/renderers/content_tag.rb |
garterbelt-0.0.8 | lib/renderers/content_tag.rb |