module Hathor::NestedMacro

Direct including types

Defined in:

macros/nested.cr

Macro Summary

Macro Detail

macro nested(nested_name, **options) #

nested macro To achieve nesting like contract.address.street, we think about the nested element as a new nested contract.

  • populates the PROPERTIES hash to a nested element
  • defines @type.id::nested_name < Contract class with yield
  • depending on nilable option
    • casts property name : @type.id::nested_name | Nil
    • casts property name : @type.id::nested_name

[View source]
macro nested!(name, **options) #

shortcut for "nilable: false" option


[View source]