Class: Arel::Nodes::AggregateFunctionName
- Inherits:
-
Node
- Object
- Node
- Arel::Nodes::AggregateFunctionName
- Includes:
- Predications, WindowPredications
- Defined in:
- lib/active_record_extended/arel/aggregate_function_name.rb
Instance Attribute Summary collapse
-
#alias ⇒ Object
Returns the value of attribute alias.
-
#distinct ⇒ Object
Returns the value of attribute distinct.
-
#expressions ⇒ Object
Returns the value of attribute expressions.
-
#name ⇒ Object
Returns the value of attribute name.
-
#orderings ⇒ Object
Returns the value of attribute orderings.
Instance Method Summary collapse
- #as(aliaz) ⇒ Object
- #eql?(other) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(name, expr, distinct = false) ⇒ AggregateFunctionName
constructor
A new instance of AggregateFunctionName.
- #order_by(expr) ⇒ Object
Methods included from Predications
#all, #any, #contained_in_array, #contains, #inet_contained_within, #inet_contained_within_or_equals, #inet_contains, #inet_contains_or_equals, #inet_contains_or_is_contained_within, #overlaps
Constructor Details
#initialize(name, expr, distinct = false) ⇒ AggregateFunctionName
Returns a new instance of AggregateFunctionName.
10 11 12 13 14 15 |
# File 'lib/active_record_extended/arel/aggregate_function_name.rb', line 10 def initialize(name, expr, distinct = false) super() @name = name.to_s.upcase @expressions = expr @distinct = distinct end |
Instance Attribute Details
#alias ⇒ Object
Returns the value of attribute alias.
8 9 10 |
# File 'lib/active_record_extended/arel/aggregate_function_name.rb', line 8 def alias @alias end |
#distinct ⇒ Object
Returns the value of attribute distinct.
8 9 10 |
# File 'lib/active_record_extended/arel/aggregate_function_name.rb', line 8 def distinct @distinct end |
#expressions ⇒ Object
Returns the value of attribute expressions.
8 9 10 |
# File 'lib/active_record_extended/arel/aggregate_function_name.rb', line 8 def expressions @expressions end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/active_record_extended/arel/aggregate_function_name.rb', line 8 def name @name end |
#orderings ⇒ Object
Returns the value of attribute orderings.
8 9 10 |
# File 'lib/active_record_extended/arel/aggregate_function_name.rb', line 8 def orderings @orderings end |
Instance Method Details
#as(aliaz) ⇒ Object
22 23 24 25 |
# File 'lib/active_record_extended/arel/aggregate_function_name.rb', line 22 def as(aliaz) self.alias = SqlLiteral.new(aliaz) self end |
#eql?(other) ⇒ Boolean Also known as: ==
31 32 33 34 35 36 |
# File 'lib/active_record_extended/arel/aggregate_function_name.rb', line 31 def eql?(other) self.class == other.class && expressions == other.expressions && orderings == other.orderings && distinct == other.distinct end |
#hash ⇒ Object
27 28 29 |
# File 'lib/active_record_extended/arel/aggregate_function_name.rb', line 27 def hash [@name, @expressions, @distinct, @alias, @orderings].hash end |
#order_by(expr) ⇒ Object
17 18 19 20 |
# File 'lib/active_record_extended/arel/aggregate_function_name.rb', line 17 def order_by(expr) @orderings = expr self end |