Module: TOMLP

Extended by:
TOMLP
Included in:
TOMLP
Defined in:
lib/tomlp.rb,
lib/tomlp/parser.rb

Defined Under Namespace

Classes: Parser

Constant Summary collapse

VERSION =
"0.0.1"

Instance Method Summary collapse

Instance Method Details

#load(filename) ⇒ Object

Public: Parse the contents of the file that is passed as arguement

filename - A String containing the filename that needs to be parsed

Returns the parsed Data Structure



23
24
25
26
# File 'lib/tomlp.rb', line 23

def load(filename)
  file_content = File.open(filename).read
  TOMLP::Parser.new(file_content).parse
end

#parse(content) ⇒ Object

Public: Parse the text passed as arguement

content - A String containing the entire content of the File in text format

Returns the parsed Data Structure



14
15
16
# File 'lib/tomlp.rb', line 14

def parse(content)
  TOMLP::Parser.new(content).parse
end