W3cubDocs

/Pony

JsonObject

[Source]

class ref JsonObject

Constructors

create

[Source]

Create a map with space for prealloc elements without triggering a resize. Defaults to 6.

new ref create(
  prealloc: USize val = 6)
: JsonObject ref^

Parameters

  • prealloc: USize val = 6

Returns

from_map

[Source]

Create a Json object from a map.

new ref from_map(
  data': HashMap[String val, (F64 val | I64 val | Bool val | None val | String val | JsonArray ref | JsonObject ref), HashEq[String val] val] ref)
: JsonObject ref^

Parameters

Returns

Public fields

var data: HashMap[String val, (F64 val | I64 val | Bool val | None val | String val | JsonArray ref | JsonObject ref), HashEq[String val] val] ref

[Source]

The actual JSON object structure, mapping String keys to other JSON structures.

Public Functions

string

[Source]

Generate string representation of this object.

fun box string(
  indent: String val = "",
  pretty_print: Bool val = false)
: String val

Parameters

  • indent: String val = ""
  • pretty_print: Bool val = false

Returns

Private Functions

_show

[Source]

Append the string representation of this object to the provided String.

fun box _show(
  buf': String iso,
  indent: String val = "",
  level: USize val,
  pretty: Bool val)
: String iso^

Parameters

Returns

© 2016-2018, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/json-JsonObject