W3cubDocs

/Crystal

module INI

Defined in:

ini.cr

Class Method Summary

Class Method Detail

def self.build(ini, space : Bool = false) : StringSource

Generates an INI-style configuration from a given hash.

require "ini"

INI.build({"foo" => {"a" => "1"}}, true) # => "[foo]\na = 1\n\n"

def self.build(io : IO, ini, space : Bool = false) : NilSource

Appends INI data to the given IO.

def self.parse(string_or_io : String | IO) : Hash(String, Hash(String, String))Source

Parses INI-style configuration from the given string. Raises a ParseException on any errors.

require "ini"

INI.parse("[foo]\na = 1") # => {"foo" => {"a" => "1"}}

© 2012–2020 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.35.1/INI.html