INI - Crystal 1.20.1

# module INI

##
Overview

NOTE To use `INI`, you must explicitly import it with `require "ini"`

##
Defined in:

ini.cr

##
Class Method Summary

- .build(ini, space : Bool = false) : String

  Generates an INI-style configuration from a given hash.

- .build(io : IO, ini, space : Bool = false) : Nil

  Appends INI data to the given IO.

- .parse(string_or_io : String | IO) : Hash(String, Hash(String, String))

  Parses INI-style configuration from the given string.

##
Class Method Detail

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

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) : Nil #

Appends INI data to the given IO.

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

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

    require "ini"

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