Class: Jotdown::Document
- Inherits:
-
Object
- Object
- Jotdown::Document
- Defined in:
- lib/jotdown.rb
Instance Attribute Summary collapse
-
#next_p ⇒ Object
Returns the value of attribute next_p.
-
#tokens ⇒ Object
Returns the value of attribute tokens.
Instance Method Summary collapse
-
#initialize(file) ⇒ Document
constructor
A new instance of Document.
- #write_file ⇒ Object
Constructor Details
#initialize(file) ⇒ Document
Returns a new instance of Document.
10 11 12 13 14 15 16 17 |
# File 'lib/jotdown.rb', line 10 def initialize(file) @tokens = [] @source = File.read(file).split("\n") @file_name = file.sub(".jd",".html") @result =[] @style =[] @nxt_line = 0 end |
Instance Attribute Details
#next_p ⇒ Object
Returns the value of attribute next_p.
8 9 10 |
# File 'lib/jotdown.rb', line 8 def next_p @next_p end |
#tokens ⇒ Object
Returns the value of attribute tokens.
8 9 10 |
# File 'lib/jotdown.rb', line 8 def tokens @tokens end |
Instance Method Details
#write_file ⇒ Object
19 20 21 22 |
# File 'lib/jotdown.rb', line 19 def write_file documnt,style = process File.write("#{@file_name}", render_to_html(documnt,style)) end |