Class: ActiveRecord::Refined::AST::Function
- Includes:
- Arithmetics, Predications, Windowing
- Defined in:
- lib/active_record/refined/ast.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, args) ⇒ Function
constructor
A new instance of Function.
- #to_arel(table, model) ⇒ Object
Methods included from Windowing
Methods included from Arithmetics
#&, #*, #+, #-, #/, #<<, #>>, #^, #|, #~
Methods included from Predications
#!=, #!~, #<, #<=, #==, #=~, #>, #>=, #between?, #bury, #casecmp?, #contains?, #dig, #dig_json, #distinct_from?, #end_with?, #false?, #ilike?, #in?, #include?, #intersect?, #key?, #like?, #member?, #not_between?, #not_distinct_from?, #not_false?, #not_ilike?, #not_in?, #not_like?, #not_null?, #not_true?, #null?, #start_with?, #subset?, #superset?, #true?, #when
Methods inherited from Node
Constructor Details
#initialize(name, args) ⇒ Function
Returns a new instance of Function.
1038 1039 1040 1041 |
# File 'lib/active_record/refined/ast.rb', line 1038 def initialize(name, args) @name = name @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
1036 1037 1038 |
# File 'lib/active_record/refined/ast.rb', line 1036 def args @args end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
1036 1037 1038 |
# File 'lib/active_record/refined/ast.rb', line 1036 def name @name end |
Instance Method Details
#to_arel(table, model) ⇒ Object
1043 1044 1045 1046 |
# File 'lib/active_record/refined/ast.rb', line 1043 def to_arel(table, model) arel_args = args.map {|arg| to_arel_argument(arg, table, model) } Arel::Nodes::NamedFunction.new(name, arel_args) end |