Class: Madan::FileParser

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

Constant Summary collapse

ALLOWED_EXTENSIONS =
%w(.md .markdown)

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ FileParser

Returns a new instance of FileParser.



6
7
8
9
# File 'lib/madan/file_parser.rb', line 6

def initialize(path)
  @path = path
  @md = Madan::MdUtils.new
end

Instance Method Details

#parseObject



11
12
13
14
15
16
17
# File 'lib/madan/file_parser.rb', line 11

def parse
  contents = ""
  if File.file?(@path)
    contents = File.read(@path)
  end
  contents
end