Class: Squeel::Nodes::Function
- Includes:
- Aliasing, Operators, Ordering, PredicateMethods, PredicateOperators
- Defined in:
- lib/squeel/nodes/function.rb
Overview
A node that represents an SQL function call
Direct Known Subclasses
Instance Attribute Summary collapse
-
#args ⇒ Array
readonly
The arguments to be passed to the SQL function.
-
#function_name ⇒ Symbol
readonly
The name of the SQL function to be called.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(function_name, args) ⇒ Function
constructor
Create a node representing an SQL Function with the given name and arguments.
-
#to_sym ⇒ NilClass
expand_hash_conditions_for_aggregates assumes our hash keys can be converted to symbols, so this has to be implemented, but it doesn’t really have to do anything useful.
Methods included from Aliasing
Methods included from Ordering
Methods included from Operators
Methods included from PredicateOperators
Methods included from PredicateMethods
Constructor Details
#initialize(function_name, args) ⇒ Function
Create a node representing an SQL Function with the given name and arguments
33 34 35 |
# File 'lib/squeel/nodes/function.rb', line 33 def initialize(function_name, args) @function_name, @args = function_name, args end |
Instance Attribute Details
#args ⇒ Array (readonly)
Returns The arguments to be passed to the SQL function.
28 29 30 |
# File 'lib/squeel/nodes/function.rb', line 28 def args @args end |
#function_name ⇒ Symbol (readonly)
Returns The name of the SQL function to be called.
25 26 27 |
# File 'lib/squeel/nodes/function.rb', line 25 def function_name @function_name end |
Instance Method Details
#eql?(other) ⇒ Boolean
49 50 51 52 53 |
# File 'lib/squeel/nodes/function.rb', line 49 def eql?(other) self.class == other.class && self.function_name.eql?(other.function_name) && self.args.eql?(other.args) end |
#hash ⇒ Object
45 46 47 |
# File 'lib/squeel/nodes/function.rb', line 45 def hash [@name, @args].hash end |
#to_sym ⇒ NilClass
expand_hash_conditions_for_aggregates assumes our hash keys can be converted to symbols, so this has to be implemented, but it doesn’t really have to do anything useful.
41 42 43 |
# File 'lib/squeel/nodes/function.rb', line 41 def to_sym nil end |