Class: ActiveRecord::Refined::AST::Function

Inherits:
Node
  • Object
show all
Includes:
Arithmetics, Predications
Defined in:
lib/active_record/refined/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Arithmetics

#*, #+, #-, #/

Methods included from Predications

#!=, #!~, #<, #<=, #==, #=~, #>, #>=, #between?, #casecmp?, #distinct_from?, #end_with?, #ilike?, #in?, #include?, #intersect?, #like?, #member?, #not_between?, #not_distinct_from?, #not_ilike?, #not_in?, #not_like?, #not_null?, #null?, #start_with?, #subset?, #superset?

Methods inherited from Node

#as, #asc, #desc

Constructor Details

#initialize(name, args) ⇒ Function

Returns a new instance of Function.



407
408
409
410
# File 'lib/active_record/refined/ast.rb', line 407

def initialize(name, args)
  @name = name
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



405
406
407
# File 'lib/active_record/refined/ast.rb', line 405

def args
  @args
end

#nameObject (readonly)

Returns the value of attribute name.



405
406
407
# File 'lib/active_record/refined/ast.rb', line 405

def name
  @name
end

Instance Method Details

#to_arel(table) ⇒ Object



412
413
414
415
# File 'lib/active_record/refined/ast.rb', line 412

def to_arel(table)
  arel_args = args.map {|arg| to_arel_argument(arg, table) }
  Arel::Nodes::NamedFunction.new(name, arel_args)
end