Class: Minidown::HtmlElement
- Defined in:
- lib/minidown/elements/html_element.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Element
#children, #content, #doc, #nodes
Instance Method Summary collapse
-
#initialize(doc, content, name) ⇒ HtmlElement
constructor
A new instance of HtmlElement.
- #parse ⇒ Object
- #to_html ⇒ Object
Methods inherited from Element
#blank?, #raw_content, #raw_content=, #unparsed_lines
Methods included from HtmlHelper
Constructor Details
#initialize(doc, content, name) ⇒ HtmlElement
Returns a new instance of HtmlElement.
5 6 7 8 |
# File 'lib/minidown/elements/html_element.rb', line 5 def initialize doc, content, name super doc, content @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/minidown/elements/html_element.rb', line 3 def name @name end |
Instance Method Details
#parse ⇒ Object
10 11 12 |
# File 'lib/minidown/elements/html_element.rb', line 10 def parse nodes << self end |
#to_html ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/minidown/elements/html_element.rb', line 14 def to_html build_tag @name do |tag| # self.content is some Element self.content = content.text if ParagraphElement === self.content tag << self.content.to_html end end |