symbol_aref.rb

lib/sequel/extensions/symbol_aref.rb
Last Update: 2016-10-14 13:06:50 -0700

The symbol_aref extension makes Symbol#[] support Symbol, Sequel::SQL::Indentifier, and Sequel::SQL::QualifiedIdentifier instances, returning appropriate Sequel::SQL::QualifiedIdentifier instances. It's designed as a shortcut so that instead of:

Sequel[:table][:column] # table.column

you can just write:

:table[:column] # table.column

To load the extension:

Sequel.extension :symbol_aref

If you are using Ruby 2+, and you would like to use refinements, there is a refinement version of this in the symbol_aref_refinement extension.

If you are using the ruby18_symbol_extensions, and would like symbol_aref to take affect, load the symbol_aref extension after the ruby18_symbol_extensions.

Related module: Sequel::SymbolAref