struct Symbol
Overview
A symbol is a constant that is identified by a name without you having to give it a numeric value.
:hello
:welcome
:"123"
:"symbol with spaces"
See Symbol
literals in the language reference.
Internally a symbol is represented as an Int32
, so it's very efficient.
You can't dynamically create symbols. When you compile your program, each symbol gets assigned a unique number.
Included Modules
- Comparable(Symbol)
Defined in:
objects.crInstance Method Summary
- #to_xml(xml : XML::Builder) : Nil
- #to_xml(io : IO, *, key : String | Nil = nil, indent : XMLT::IndentOptions = nil) : Nil
- #to_xml(*, key : String | Nil = nil, indent : XMLT::IndentOptions = nil) : String
Instance methods inherited from class Object
to_xml(io : IO, *, indent : XMLT::IndentOptions = nil) : Nilto_xml(*, indent : XMLT::IndentOptions = nil) : String to_xml
Class methods inherited from class Object
from_xml(xml : String)from_xml(node : XML::Node)
from_xml(xml : String, *, root : String)
from_xml(node : XML::Node, *, root : String) from_xml