Method: Egalite::HTMLTagBuilder#_tag

Defined in:
lib/egalite/helper.rb

#_tag(name, soc, attributes) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/egalite/helper.rb', line 8

def _tag(name , soc, attributes)
  close = soc == :close ? '/' : ''
  solo = soc == :solo ? '/' : ''
  
  atr = if attributes and not attributes.empty?
    s = attributes.map { |k,v| "#{escape_html(k)}='#{escape_html(v)}'" }.join(' ')
    " #{s}"
  else
    ""
  end
  NonEscapeString.new("<#{close}#{escape_html(name)}#{atr}#{solo}>")
end