[ next ] [ prev ] [ contents ] XP-Cinti TDD Workshop

Ruby Symbols

An identifier preceeded by a colon (e.g. :BLACK) is a Symbol object. Symbols are much like strings, but with the following properties.

Symbols are used internally by Ruby to implement method names. Ruby programmers often use Symbols as named enumerations (e.g. :RED, :GREEN, :BLUE).


[ next ] [ prev ] [ contents ] Copyright 2003 by Jim Weirich.
Some Rights Reserved