module HCL::Serializable::Unmapped

Overview

Modifies behavior of HCL::Serializable such that unknown attributes and blocks in the HCL document will be stored in respective Hash(String, HCL::AST::Node).

For classes/structs representing blocks, any unmapped labels will be stored in a Hash(Int32, HCL::AST::Node), where the key is the label index.

On serialization, any keys inside #hcl_unmapped_attributes, #hcl_unmapped_blocks, and #hcl_unmapped_labels will be serialized and appended to the current HCL block or document.

The deserialized values are AST nodes in order to allow for later evaluation, perhaps with a different expression context than the original document.

Defined in:

hcl/serializable.cr

Instance Method Summary

Instance Method Detail

def hcl_unmapped_attributes : Hash(String, HCL::AST::Node) #

Unmapped attribute nodes. Key is the name of the attribute. Value is the AST node


[View source]
def hcl_unmapped_attributes=(hcl_unmapped_attributes : Hash(String, HCL::AST::Node)) #

Unmapped attribute nodes. Key is the name of the attribute. Value is the AST node


[View source]
def hcl_unmapped_blocks : Hash(String, Array(HCL::AST::Block)) #

Unmapped block node groups. Key is the ID/type of the block. Value is the AST node.


[View source]
def hcl_unmapped_blocks=(hcl_unmapped_blocks : Hash(String, Array(HCL::AST::Block))) #

Unmapped block node groups. Key is the ID/type of the block. Value is the AST node.


[View source]
def hcl_unmapped_labels : Hash(Int32, HCL::AST::Node) #

Unmapped label nodes. Key is the index of the label. Value is the AST node. This will only be populated for classes/structs represented as blocks in another class/struct implementing HCL::Serializable.


[View source]
def hcl_unmapped_labels=(hcl_unmapped_labels : Hash(Int32, HCL::AST::Node)) #

Unmapped label nodes. Key is the index of the label. Value is the AST node. This will only be populated for classes/structs represented as blocks in another class/struct implementing HCL::Serializable.


[View source]