Zuzu::Value::Dict(3)

NAME
Zuzu::Value::Dict - runtime value class for dict values

DESCRIPTION
Wraps runtime dictionary/hash values and provides truthiness semantics for collections.

INHERITANCE
Inherits from "Moo::Object".

ROLES
None.

ATTRIBUTES

  map
Type: HashRef.

Dictionary storage map from keys to runtime values.

METHODS

  new
Constructs and returns a new instance of this class.

  is_truthy
Returns this runtime value's truthiness in ZuzuScript.

  keys
Returns dictionary keys as a set.

  values
Returns dictionary values as a bag.

  contains_key
Returns true when the provided key exists.

  get
Returns the value for a key or an optional default value.

  to_Array
Returns an array of "[ key, value ]" pairs.

  add
Adds one or more key-value pairs and returns this dictionary.

  remove
Deletes one key and returns this dictionary.

  length
Returns the number of keys.

  empty
Returns true when the dictionary has no keys.

  clear
Removes all keys and returns this dictionary.

SEE ALSO
Subclasses: none in this distribution.

COPYRIGHT AND LICENCE
Zuzu::Value::Dict is copyright Toby Inkster.

It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.