Class: AsciiDoc::AsciiElement
- Inherits:
-
Object
- Object
- AsciiDoc::AsciiElement
- Defined in:
- lib/asciidoc/asciielement.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#attributes ⇒ Object
AsciiDoc Attributes —————————————————.
- #attributes=(att) ⇒ Object
-
#initialize(type) ⇒ AsciiElement
constructor
A new instance of AsciiElement.
- #render(views) ⇒ Object
- #standard_render(views) ⇒ Object
Constructor Details
#initialize(type) ⇒ AsciiElement
Returns a new instance of AsciiElement.
7 8 9 10 |
# File 'lib/asciidoc/asciielement.rb', line 7 def initialize(type) @type = type @children = [] end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
5 6 7 |
# File 'lib/asciidoc/asciielement.rb', line 5 def children @children end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/asciidoc/asciielement.rb', line 5 def type @type end |
Instance Method Details
#attributes ⇒ Object
AsciiDoc Attributes
33 34 35 |
# File 'lib/asciidoc/asciielement.rb', line 33 def attributes @attributes end |
#attributes=(att) ⇒ Object
37 38 39 |
# File 'lib/asciidoc/asciielement.rb', line 37 def attributes=(att) @attributes = att end |
#render(views) ⇒ Object
12 13 14 15 16 |
# File 'lib/asciidoc/asciielement.rb', line 12 def render(views) element = self raise Exception, "Template file doesn't exist: #{@type}" if views[@type].nil? views[@type].result(binding) end |
#standard_render(views) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/asciidoc/asciielement.rb', line 18 def standard_render(views) content = "" @children.each do |child| if(child.is_a? String) content += child else content += child.render(views) end end content end |