Module: Otterraft

Defined in:
lib/otterraft.rb,
lib/otterraft/parser.rb,
lib/otterraft/version.rb

Defined Under Namespace

Classes: Parser

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.parse(text) ⇒ Object



7
8
9
# File 'lib/otterraft.rb', line 7

def self.parse(text)
  Parser.new(text).parse
end

.parse_file(pathname) ⇒ Object



11
12
13
14
# File 'lib/otterraft.rb', line 11

def self.parse_file(pathname)
  raise "File not found: #{pathname}" unless File.exist?(pathname)
  Parser.new(File.read(pathname)).parse
end