module Haml::Temple::Expressions

Public Instance Methods

on_doctype() click to toggle source
# File lib/haml/temple.rb, line 17
def on_doctype
  [:html, :doctype, value[:version] || 5]
end
on_plain() click to toggle source
# File lib/haml/temple.rb, line 9
def on_plain
  [:static, "\n" + value[:text]]
end
on_root() click to toggle source
# File lib/haml/temple.rb, line 13
def on_root
  [:multi]
end
on_tag() click to toggle source
# File lib/haml/temple.rb, line 21
def on_tag
  exp = [:html, :tag, value[:name], [:html, :attrs]]
  if value[:value] && value[:value] != ""
    if value[:parse]
      exp.push << [:dynamic, value[:value]]
    else
      exp.push << [:static, value[:value]]
    end
  end

  if attribs = value[:attributes]
    attribs.each do |key, value|
      exp.last << [:html, :attr, key, [:static, value]]
    end
  end

  exp
end