class Slim::Embedded::TagEngine

Tag wrapper engine Generates a html tag and wraps another engine (specified via :engine option)

Public Instance Methods

on_slim_embedded(engine, body, attrs) click to toggle source
# File lib/slim/embedded.rb, line 191
def on_slim_embedded(engine, body, attrs)

  unless options[:attributes].empty?
    options[:attributes].map do|k, v|
      attrs << [:html, :attr, k, [:static, v]]
    end
  end

  if options[:engine]
    opts = {}.update(options)
    opts.delete(:engine)
    opts.delete(:tag)
    opts.delete(:attributes)
    @engine ||= options[:engine].new(opts)
    body = @engine.on_slim_embedded(engine, body, attrs)
  end

  [:html, :tag, options[:tag], attrs, body]
end