class Crystal::Macros::HashLiteral
inherits Crystal::Macros::ASTNode
¶
A hash literal.
Methods¶
#double_splat(trailing_string : StringLiteral = nil) : MacroId
¶
(trailing_string : StringLiteral = nil) : MacroId
Returns a MacroId
with all of this hash elements joined
by commas.
If trailing_string is given, it will be appended to the result unless this hash is empty. This lets you splat a hash and optionally write a trailing comma if needed.
#of_key : ASTNode | Nop
¶
: ASTNode | Nop
Returns the type specified at the end of the Hash literal, if any.
This refers to the key type after brackets in {} of String => Int32
.
#of_value : ASTNode | Nop
¶
: ASTNode | Nop
Returns the type specified at the end of the Hash literal, if any.
This refers to the value type after brackets in {} of String => Int32
.
#type : Path | Nop
¶
: Path | Nop
Returns the type that receives the items of the array.
This refers to the part before brackets in MyHash{'a' => 1, 'b' => 2}