Class: Minidown::LineElement
- Defined in:
- lib/minidown/elements/line_element.rb
Instance Attribute Summary collapse
-
#display ⇒ Object
Returns the value of attribute display.
Attributes inherited from Element
#children, #content, #doc, #nodes
Instance Method Summary collapse
- #blank? ⇒ Boolean
-
#initialize(doc, content = nil) ⇒ LineElement
constructor
A new instance of LineElement.
- #parse ⇒ Object
- #to_html ⇒ Object
Methods inherited from Element
#raw_content, #raw_content=, #unparsed_lines
Methods included from HtmlHelper
Constructor Details
#initialize(doc, content = nil) ⇒ LineElement
Returns a new instance of LineElement.
5 6 7 8 |
# File 'lib/minidown/elements/line_element.rb', line 5 def initialize doc, content=nil super @display = true end |
Instance Attribute Details
#display ⇒ Object
Returns the value of attribute display.
3 4 5 |
# File 'lib/minidown/elements/line_element.rb', line 3 def display @display end |
Instance Method Details
#blank? ⇒ Boolean
10 11 12 |
# File 'lib/minidown/elements/line_element.rb', line 10 def blank? true end |
#parse ⇒ Object
14 15 16 17 18 |
# File 'lib/minidown/elements/line_element.rb', line 14 def parse node = nodes.last @display = (doc.within_block || TextElement === node) nodes << self end |
#to_html ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/minidown/elements/line_element.rb', line 20 def to_html if @display br_tag else '' end end |