Class: Eskimo::HTML::Html
- Defined in:
- gems/eskimo-html/lib/eskimo/html/components/html.rb
Constant Summary
Constants inherited from Component
Instance Attribute Summary
Attributes inherited from Component
#attributes, #children, #tag_name
Instance Method Summary collapse
-
#initialize(doctype: 'html') ⇒ Html
constructor
A new instance of Html.
- #render ⇒ Object
Constructor Details
#initialize(doctype: 'html') ⇒ Html
Returns a new instance of Html
5 6 7 8 9 10 |
# File 'gems/eskimo-html/lib/eskimo/html/components/html.rb', line 5 def initialize(doctype: 'html', **) @doctype = doctype @tag_name = 'html' super @attributes.delete(:doctype) end |
Instance Method Details
#render ⇒ Object
12 13 14 15 16 17 18 |
# File 'gems/eskimo-html/lib/eskimo/html/components/html.rb', line 12 def render(**) if @doctype.to_s.empty? super else "<!DOCTYPE #{@doctype}>\n" + super end end |