Class: Leandocument::Render
- Inherits:
-
Object
- Object
- Leandocument::Render
- Defined in:
- lib/leandocument/render.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#indent ⇒ Object
Returns the value of attribute indent.
-
#p_toc ⇒ Object
Returns the value of attribute p_toc.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #analyse_content ⇒ Object
- #content_ary ⇒ Object
-
#initialize(options = {}) ⇒ Render
constructor
A new instance of Render.
- #title ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Render
Returns a new instance of Render.
4 5 6 7 8 |
# File 'lib/leandocument/render.rb', line 4 def initialize( = {}) self.content = [:content] self.indent = [:indent] self.path = [:path] end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
3 4 5 |
# File 'lib/leandocument/render.rb', line 3 def content @content end |
#indent ⇒ Object
Returns the value of attribute indent.
3 4 5 |
# File 'lib/leandocument/render.rb', line 3 def indent @indent end |
#p_toc ⇒ Object
Returns the value of attribute p_toc.
3 4 5 |
# File 'lib/leandocument/render.rb', line 3 def p_toc @p_toc end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/leandocument/render.rb', line 3 def path @path end |
Instance Method Details
#analyse_content ⇒ Object
10 11 12 |
# File 'lib/leandocument/render.rb', line 10 def analyse_content content = content_ary[1..-1].join("\n") end |
#content_ary ⇒ Object
14 15 16 |
# File 'lib/leandocument/render.rb', line 14 def content_ary content.split(/\r\n|\r|\n/) end |
#title ⇒ Object
18 19 20 |
# File 'lib/leandocument/render.rb', line 18 def title content_ary[0] end |