Class: Hanami::Helpers::HtmlHelper::EmptyHtmlNode Private
- Inherits:
-
Object
- Object
- Hanami::Helpers::HtmlHelper::EmptyHtmlNode
- Defined in:
- lib/hanami/helpers/html_helper/empty_html_node.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Empty HTML node
Direct Known Subclasses
Constant Summary collapse
- BOOLEAN_ATTRIBUTES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
List of attributes that get special treatment when rendering.
%w[ allowfullscreen async autobuffer autofocus autoplay checked compact controls declare default defaultchecked defaultmuted defaultselected defer disabled draggable enabled formnovalidate hidden indeterminate inert ismap itemscope loop multiple muted nohref noresize noshade novalidate nowrap open pauseonexit pubdate readonly required reversed scoped seamless selected sortable spellcheck translate truespeed typemustmatch visible ].freeze
- ATTRIBUTES_SEPARATOR =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Attributes separator
' '.freeze
Instance Method Summary collapse
-
#initialize(name, attributes) ⇒ Hanami::Helpers::HtmlHelper::EmptyHtmlNode
constructor
private
Initialize a new empty HTML node.
-
#to_s ⇒ String
private
Resolve and return the output.
Constructor Details
#initialize(name, attributes) ⇒ Hanami::Helpers::HtmlHelper::EmptyHtmlNode
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize a new empty HTML node
79 80 81 82 |
# File 'lib/hanami/helpers/html_helper/empty_html_node.rb', line 79 def initialize(name, attributes) @name = name @attributes = prepare_html_attributes(attributes) end |
Instance Method Details
#to_s ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Resolve and return the output
90 91 92 |
# File 'lib/hanami/helpers/html_helper/empty_html_node.rb', line 90 def to_s %(<#{@name}#{attributes}>) end |