module VDF
Main VDF
module @author sapphyrus
Constants
- VERSION
The current version
Public Class Methods
Parses a VDF
document into a Ruby Hash and returns it
For large files, it's recommended to pass the File object to VDF.parse
instead of reading the whole File contents into memory
@param input [String, File, to_str, each_line] the input object @return [Hash] the contents of the VDF
document, parsed into a Ruby Hash @raise [ParserError] if the VDF
document is invalid @example Parse the contents of a VDF
String
contents = VDF.parse(string)
@example Parse the contents of a VDF
File
File.open("filename.vdf", "r") do |file| contents = VDF.parse(file) puts contents.inspect end
# File lib/vdf/parse.rb, line 128 def parse(input) Parser.parse(input) end
Private Instance Methods
Parses a VDF
document into a Ruby Hash and returns it
For large files, it's recommended to pass the File object to VDF.parse
instead of reading the whole File contents into memory
@param input [String, File, to_str, each_line] the input object @return [Hash] the contents of the VDF
document, parsed into a Ruby Hash @raise [ParserError] if the VDF
document is invalid @example Parse the contents of a VDF
String
contents = VDF.parse(string)
@example Parse the contents of a VDF
File
File.open("filename.vdf", "r") do |file| contents = VDF.parse(file) puts contents.inspect end
# File lib/vdf/parse.rb, line 128 def parse(input) Parser.parse(input) end