Class: Symbol

Inherits:
Object
  • Object
show all
Includes:
Squeel::Nodes::Aliasing, Squeel::PredicateMethods
Defined in:
lib/core_ext/symbol.rb

Overview

These extensions to Symbol are loaded optionally, mostly to provide a small amount of backwards compatibility with MetaWhere.

Examples:

Load Symbol extensions

Squeel.configure do |config|
  config.load_core_extensions :symbol
end

Instance Method Summary collapse

Methods included from Squeel::Nodes::Aliasing

#as

Instance Method Details

#ascObject



15
16
17
# File 'lib/core_ext/symbol.rb', line 15

def asc
  Squeel::Nodes::Order.new self, 1
end

#descObject



19
20
21
# File 'lib/core_ext/symbol.rb', line 19

def desc
  Squeel::Nodes::Order.new self, -1
end

#func(*args) ⇒ Object



23
24
25
# File 'lib/core_ext/symbol.rb', line 23

def func(*args)
  Squeel::Nodes::Function.new(self, args)
end

#innerObject



27
28
29
# File 'lib/core_ext/symbol.rb', line 27

def inner
  Squeel::Nodes::Join.new(self, Arel::InnerJoin)
end

#of_class(klass) ⇒ Object



35
36
37
# File 'lib/core_ext/symbol.rb', line 35

def of_class(klass)
  Squeel::Nodes::Join.new(self, Arel::InnerJoin, klass)
end

#outerObject



31
32
33
# File 'lib/core_ext/symbol.rb', line 31

def outer
  Squeel::Nodes::Join.new(self, Arel::OuterJoin)
end