> For the complete documentation index, see [llms.txt](https://ysk.snesjhon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ysk.snesjhon.com/ruby/symbols.md).

# Symbols

A symbol looks like a variable name but it's prefixed with a colon. Examples - **:action**, **:line\_items**. You don't have to pre-declare a symbol and they are guaranteed to be unique.&#x20;

You can consider the colon to mean "thing named" so `:id` is "the thing named id."&#x20;

> A **Symbol** is the most basic Ruby object you can create. It's just a name and an internal ID. Symbols are useful because a given symbol name refers to the same object throughout a Ruby program. Symbols are more efficient than strings. Two strings with the same contents are two different objects, but for any given name there is only one Symbol object. This can save both time and memory.

## Resources

* <http://rubylearning.com/satishtalim/ruby_symbols.html>
