Language
Version: 2.2.0
Categories
-
User Program Communication
-
Variables
-
Control Flow
-
Functions and Blocks
-
Object Oriented Programming
Variables
Symbols in Ruby
A symbol is an identifier whose name is immutable (cannot be changed at runtime).
Syntax
:symbol_name
Notes
These are used to convey states or specific values. Symbols are popular with key-value store for hash tables.
Example
state = :changed