class Crystal::Macros::NamedTupleLiteral
Overview
A named tuple literal.
Defined in:
compiler/crystal/macros.crInstance Method Summary
-
#[](key : SymbolLiteral | StringLiteral | MacroId) : ASTNode
Similar to
NamedTuple#[]
but returnsNilLiteral
if key is undefined. -
#[]=(key : SymbolLiteral | StringLiteral | MacroId, value : ASTNode) : ASTNode
Adds or replaces a key.
-
#double_splat(trailing_string : StringLiteral = nil) : MacroId
Similar to
HashLiteral#double_splat
-
#each(&) : Nil
Similar to
NamedTuple#each
-
#each_with_index(&) : Nil
Similar to
NamedTuple#each_with_index
-
#empty? : BoolLiteral
Similar to
NamedTuple#empty?
-
#has_key?(key : SymbolLiteral | StringLiteral | MacroId) : ASTNode
Similar to
NamedTuple#has_key?
-
#keys : ArrayLiteral
Similar to
NamedTuple#keys
-
#map : ArrayLiteral
Similar to
NamedTuple#map
-
#size : NumberLiteral
Similar to
NamedTuple#size
-
#to_a : ArrayLiteral(TupleLiteral)
Similar to
NamedTuple#to_a
-
#values : ArrayLiteral
Similar to
NamedTuple#values
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,
doc : StringLiteral
doc,
doc_comment : MacroId
doc_comment,
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.
Adds or replaces a key.
Similar to HashLiteral#double_splat
Similar to NamedTuple#has_key?