Class: Tablette::HTMLRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/tablette/html_renderer.rb

Direct Known Subclasses

ActionViewRenderer

Instance Method Summary collapse

Instance Method Details

#element=(element) ⇒ Object



3
4
5
# File 'lib/tablette/html_renderer.rb', line 3

def element=(element)

end

#produce_element(tag, attributes, content) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/tablette/html_renderer.rb', line 7

def produce_element(tag, attributes, content)
  content = content.join if content.kind_of? Array
  
  buffer = "<#{tag}"
  if attributes.any?
    buffer << " #{to_html_args(attributes)}"
  end

  buffer << ">#{content}</#{tag}>"

  buffer
end

#to_html(root) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/tablette/html_renderer.rb', line 20

def to_html(root)
  if root.kind_of? Array
    root.join
  else
    root
  end
end

#wrap_content(proc) ⇒ Object



28
29
30
# File 'lib/tablette/html_renderer.rb', line 28

def wrap_content(proc)
  proc
end