Class: Rux::DefaultTagBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/rux/default_tag_builder.rb

Instance Method Summary collapse

Instance Method Details

#call(tag_name, attributes = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/rux/default_tag_builder.rb', line 3

def call(tag_name, attributes = {})
  attr_str = attributes.empty? ? '' : " #{serialize_attrs(attributes)}"
  "<#{tag_name}#{attr_str}>" <<
    (block_given? ? Array(yield) : []).join <<
    "</#{tag_name}>"
end