module CON
Defined in:
lexer.crbuilder.cr
con.cr
Class Method Summary
-
.build(io : IO, indent : String? = nil, &block)
Writes CON into the given
IO
. -
.build(indent = nil, &block)
Returns the resulting
String
of writing CON to the yieldedCON::Builder
. - .parse(source : String | IO) : Any
Class Method Detail
Writes CON into the given IO
. A CON::Builder
is yielded to the block.
def self.build(indent = nil, &block)
#
Returns the resulting String
of writing CON to the yielded CON::Builder
.
require "con"
string = CON.build do |con|
con.hash do
con.field "name", "foo"
con.hash "values" do
con.array do
con.value 1
con.value 2
con.value 3
end
end
end
end
string # => %<name "foo" values[1 2 3]>