module Sequel::SymbolAref

  1. lib/sequel/extensions/symbol_aref.rb
  2. lib/sequel/extensions/symbol_aref_refinement.rb
  3. show all

The symbol_aref extension makes Symbol#[] support Symbol, Sequel::SQL::Identifier, 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

There is a refinement version of this in the symbol_aref_refinement extension.

Related module: Sequel::SymbolAref

Methods

Public Instance

  1. []

Public Instance methods

[](v)
[show source]
   # File lib/sequel/extensions/symbol_aref.rb
23 def [](v)
24   case v
25   when Symbol, Sequel::SQL::Identifier, Sequel::SQL::QualifiedIdentifier
26     Sequel::SQL::QualifiedIdentifier.new(self, v)
27   else
28     super
29   end
30 end