Class: Minidown::Element
- Inherits:
-
Object
- Object
- Minidown::Element
- Includes:
- HtmlHelper
- Defined in:
- lib/minidown/element.rb
Direct Known Subclasses
BlockElement, CodeBlockElement, DividingLineElement, HtmlElement, IndentCodeElement, LineElement, ListElement, ListGroupElement, ParagraphElement, RawHtmlElement, TableElement, TextElement
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#content ⇒ Object
Returns the value of attribute content.
-
#doc ⇒ Object
Returns the value of attribute doc.
-
#nodes ⇒ Object
Returns the value of attribute nodes.
Instance Method Summary collapse
- #blank? ⇒ Boolean
-
#initialize(doc, content) ⇒ Element
constructor
A new instance of Element.
- #parse ⇒ Object
- #raw_content ⇒ Object
- #raw_content=(str) ⇒ Object
- #to_html ⇒ Object
- #unparsed_lines ⇒ Object
Methods included from HtmlHelper
Constructor Details
#initialize(doc, content) ⇒ Element
Returns a new instance of Element.
21 22 23 24 25 26 |
# File 'lib/minidown/element.rb', line 21 def initialize doc, content @doc = doc @nodes = doc.nodes @content = content @children = [] end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
5 6 7 |
# File 'lib/minidown/element.rb', line 5 def children @children end |
#content ⇒ Object
Returns the value of attribute content.
5 6 7 |
# File 'lib/minidown/element.rb', line 5 def content @content end |
#doc ⇒ Object
Returns the value of attribute doc.
5 6 7 |
# File 'lib/minidown/element.rb', line 5 def doc @doc end |
#nodes ⇒ Object
Returns the value of attribute nodes.
5 6 7 |
# File 'lib/minidown/element.rb', line 5 def nodes @nodes end |
Instance Method Details
#blank? ⇒ Boolean
36 37 38 |
# File 'lib/minidown/element.rb', line 36 def blank? false end |
#parse ⇒ Object
28 29 30 |
# File 'lib/minidown/element.rb', line 28 def parse raise NotImplementedError, 'method parse not implemented' end |
#raw_content ⇒ Object
9 10 11 |
# File 'lib/minidown/element.rb', line 9 def raw_content @content end |
#raw_content=(str) ⇒ Object
13 14 15 |
# File 'lib/minidown/element.rb', line 13 def raw_content= str @content = str end |
#to_html ⇒ Object
32 33 34 |
# File 'lib/minidown/element.rb', line 32 def to_html raise NotImplementedError, 'method to_html not implemented' end |
#unparsed_lines ⇒ Object
17 18 19 |
# File 'lib/minidown/element.rb', line 17 def unparsed_lines doc.lines end |