Class: Madan::FileParser
- Inherits:
-
Object
- Object
- Madan::FileParser
- Defined in:
- lib/madan/file_parser.rb
Constant Summary collapse
- ALLOWED_EXTENSIONS =
%w(.md .markdown)
Instance Method Summary collapse
-
#initialize(path) ⇒ FileParser
constructor
A new instance of FileParser.
- #parse ⇒ Object
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
#parse ⇒ Object
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 |