Class: Jotdown::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/jotdown.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pObject

Returns the value of attribute next_p.



8
9
10
# File 'lib/jotdown.rb', line 8

def next_p
  @next_p
end

#tokensObject

Returns the value of attribute tokens.



8
9
10
# File 'lib/jotdown.rb', line 8

def tokens
  @tokens
end

Instance Method Details

#write_fileObject



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