class Crystal::Macros::NamedTupleLiteral

Overview

A named tuple literal.

Defined in:

compiler/crystal/macros.cr

Instance Method Summary

Instance methods inherited from class Crystal::Macros::ASTNode

!=(other : ASTNode) : BoolLiteral !=, ==(other : ASTNode) : BoolLiteral ==, class_name : StringLiteral class_name, column_number : StringLiteral | NilLiteral column_number, end_column_number : StringLiteral | NilLiteral end_column_number, end_line_number : StringLiteral | NilLiteral end_line_number, filename : StringLiteral | NilLiteral filename, id : MacroId id, is_a?(type : TypeNode) : BoolLiteral is_a?, line_number : StringLiteral | NilLiteral line_number, nil? : BoolLiteral nil?, raise(message) : NoReturn raise, stringify : StringLiteral stringify, symbolize : SymbolLiteral symbolize, warning(message : StringLiteral) : NilLiteral warning

Instance Method Detail

Similar to NamedTuple#[] but returns NilLiteral if key is undefined.


[View source]
def []=(key : SymbolLiteral | StringLiteral | MacroId, value : ASTNode) : ASTNode #

Adds or replaces a key.


[View source]
def double_splat(trailing_string : StringLiteral = nil) : MacroId #

[View source]
def each(&) : Nil #

Similar to NamedTuple#each


[View source]
def each_with_index(&) : Nil #

[View source]
def empty? : BoolLiteral #

Similar to NamedTuple#empty?


[View source]
def keys : ArrayLiteral #

Similar to NamedTuple#keys


[View source]
def map : ArrayLiteral #

Similar to NamedTuple#map


[View source]
def size : NumberLiteral #

Similar to NamedTuple#size


[View source]

Similar to NamedTuple#to_a


[View source]
def values : ArrayLiteral #

Similar to NamedTuple#values


[View source]