Class: Eskimo::HTML::Html
Constant Summary
Constants inherited from Component
Instance Attribute Summary
Attributes inherited from Component
#attributes, #children, #tag_name, #void
Instance Method Summary collapse
-
#initialize(doctype: 'html') ⇒ Html
constructor
A new instance of Html.
- #render ⇒ Object
Methods inherited from Component
Constructor Details
#initialize(doctype: 'html') ⇒ Html
Returns a new instance of Html.
36 37 38 39 40 41 |
# File 'lib/eskimo/html.rb', line 36 def initialize(doctype: 'html', **) @doctype = doctype @tag_name = 'html' super @attributes.delete(:doctype) end |
Instance Method Details
#render ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/eskimo/html.rb', line 43 def render(**) if @doctype.to_s.empty? super else "<!DOCTYPE #{@doctype}>\n" + super end end |