Class: Arel::Nodes::Function
- Includes:
- Expression
- Defined in:
- lib/arel/nodes/function.rb
Direct Known Subclasses
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.
Instance Method Summary collapse
- #as(aliaz) ⇒ Object
-
#initialize(expr, aliaz = nil) ⇒ Function
constructor
A new instance of Function.
Methods included from OrderPredications
Methods inherited from Node
#and, #each, #not, #or, #to_sql
Methods included from FactoryMethods
#create_and, #create_join, #create_on, #create_string_join, #create_table_alias, #grouping, #lower
Constructor Details
#initialize(expr, aliaz = nil) ⇒ Function
Returns a new instance of Function.
7 8 9 10 11 |
# File 'lib/arel/nodes/function.rb', line 7 def initialize expr, aliaz = nil @expressions = expr @alias = aliaz && SqlLiteral.new(aliaz) @distinct = false end |
Instance Attribute Details
#alias ⇒ Object
Returns the value of attribute alias.
5 6 7 |
# File 'lib/arel/nodes/function.rb', line 5 def alias @alias end |
#distinct ⇒ Object
Returns the value of attribute distinct.
5 6 7 |
# File 'lib/arel/nodes/function.rb', line 5 def distinct @distinct end |
#expressions ⇒ Object
Returns the value of attribute expressions.
5 6 7 |
# File 'lib/arel/nodes/function.rb', line 5 def expressions @expressions end |
Instance Method Details
#as(aliaz) ⇒ Object
13 14 15 16 |
# File 'lib/arel/nodes/function.rb', line 13 def as aliaz self.alias = SqlLiteral.new(aliaz) self end |