class

RNS::ConfigObj::Section

Inherits Reference < Object

A section within a config file, at a given nesting depth.

Constructors

new(parent : Section | Nil, depth : Int32, name : String = "")
Source

Instance methods

[](key : String) : Value
Source
[]=(key : String, value : String)
Source
[]=(key : String, value : Array(String))
Source
add_section(name : String) : Section
Source
as_bool(key : String) : Bool
Source
as_float(key : String) : Float64
Source
as_int(key : String) : Int32
Source
as_list(key : String) : Array(String)
Source
depth
Source
depth=(depth : Int32)
Source
get(key : String, default : String) : String
Source
has_key?(key : String) : Bool
Source
name
Source
name=(name : String)
Source
parent
Source
scalars
Source
scalars=(scalars : Array(String))
Source
section(name : String) : Section
Source
sections
Source
sections=(sections : Array(String))
Source
size
Source
to_string_hash

Convert this section's scalar key-value pairs to a Hash(String, String). Only includes string values (not subsections or arrays). Useful for passing configuration to interface constructors.

Source
write_lines(indent_type : String = " ") : Array(String)

Write this section's content as config lines

Source