Crystal::Macros::HashLiteral
Inherits Crystal::Macros::ASTNode
A hash literal.
Instance methods
double_splat(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
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
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
Returns the type that receives the items of the array.
This refers to the part before brackets in MyHash{'a' => 1, 'b' => 2}