class Taskpaper::Document

Attributes

doc[RW]
filename[RW]
text[RW]

Public Class Methods

new(taskpaper) click to toggle source
# File lib/taskpaper/document.rb, line 16
def initialize(taskpaper)
  if File.exists?(taskpaper)
    @text = File.open(taskpaper, "r").read
  else
    @text = taskpaper
  end
  parse
end

Public Instance Methods

inspect() click to toggle source
# File lib/taskpaper/document.rb, line 37
def inspect
  doc.map(&:inspect)
end
parse() click to toggle source
# File lib/taskpaper/document.rb, line 6
def parse
  @doc = []
  text.each_line do |line|
    item = Taskpaper::Item.new line
    @doc << item.classify.new(line)
  end
  @doc
end
to_html() click to toggle source
# File lib/taskpaper/document.rb, line 29
def to_html
  # TODO: to_html
end
to_json() click to toggle source
# File lib/taskpaper/document.rb, line 33
def to_json
  # TODO: to_json
end
to_text() click to toggle source
# File lib/taskpaper/document.rb, line 25
def to_text
  text
end