Module: Spider::QueryFuncs

Defined in:
lib/spiderfw/model/query_funcs.rb

Defined Under Namespace

Classes: AggregateFunction, Avg, BinaryFunction, Concat, Count, CurrentDate, Expression, First, Function, Last, Length, Max, Min, NAryFunction, RowNum, Substr, Subtract, Sum, Trim, UnaryFunction, ZeroArityFunction

Class Method Summary collapse

Class Method Details

.add_query_func(name, klass) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/spiderfw/model/query_funcs.rb', line 12

def self.add_query_func(name, klass)
    (class << self; self; end).module_eval do
        define_method(name) do |*args|
            return klass.new(*args)
        end
    end
    define_method(name) do |*args|
        return klass.new(*args)
    end
end

.included(mod) ⇒ Object



7
8
9
10
# File 'lib/spiderfw/model/query_funcs.rb', line 7

def self.included(mod)
    mod.extend(self)
    super
end