struct Stacker::Value
- Stacker::Value
- Struct
- Value
- Object
Overview
Value
represents an object inside the Stacker runtime.
It wraps a Crystal value in #raw and defines methods to access properties of the wrapped value while being agnostic about the actual type of the wrapped raw value.
Defined in:
stacker/value.crConstructors
Class Method Summary
-
.convert_array(array : Array)
Convert an Array object into a Stacker::Value object.
-
.convert_hash(hash : Hash)
Convert a Hash object into a Stacker::Value object.
-
.deep_merge!(hash, other_hash)
Recursively merge two Stacker::Value object.
-
.from_yaml(yaml : String)
Parse yaml and convert the result object into Stacker::Value object.
Instance Method Summary
- #[](key : String)
- #[]=(key : String, value)
- #[]?(key : String)
- #deep_merge!(other)
- #delete(*args, **options)
- #delete(*args, **options, &)
- #each(*args, **options)
- #each(*args, **options, &)
- #raw : Hash(String, Stacker::Value::Type)
- #to_json(*args, **options)
- #to_json(*args, **options, &)
- #to_yaml(*args, **options)
- #to_yaml(*args, **options, &)
Constructor Detail
Class Method Detail
def self.deep_merge!(hash, other_hash)
#
Recursively merge two Stacker::Value object.
It merges other_hash in hash and returns the modified hash.
def self.from_yaml(yaml : String)
#
Parse yaml and convert the result object into Stacker::Value object.