Class: Minidown::Element

Inherits:
Object
  • Object
show all
Includes:
HtmlHelper
Defined in:
lib/minidown/element.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HtmlHelper

#br_tag, #build_tag

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

#childrenObject

Returns the value of attribute children.



5
6
7
# File 'lib/minidown/element.rb', line 5

def children
  @children
end

#contentObject

Returns the value of attribute content.



5
6
7
# File 'lib/minidown/element.rb', line 5

def content
  @content
end

#docObject

Returns the value of attribute doc.



5
6
7
# File 'lib/minidown/element.rb', line 5

def doc
  @doc
end

#nodesObject

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

Returns:

  • (Boolean)


36
37
38
# File 'lib/minidown/element.rb', line 36

def blank?
  false
end

#parseObject

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/minidown/element.rb', line 28

def parse
  raise NotImplementedError, 'method parse not implemented'
end

#raw_contentObject



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_htmlObject

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/minidown/element.rb', line 32

def to_html
  raise NotImplementedError, 'method to_html not implemented'
end

#unparsed_linesObject



17
18
19
# File 'lib/minidown/element.rb', line 17

def unparsed_lines
  doc.lines
end