Class: PGB::FunctionCall
- Inherits:
-
Expression
- Object
- Expression
- PGB::FunctionCall
- Defined in:
- lib/pgb/function_call.rb
Instance Method Summary collapse
-
#initialize(function, *args) ⇒ FunctionCall
constructor
A new instance of FunctionCall.
- #to_sql ⇒ Object
Methods included from SQLDisplayable
Constructor Details
#initialize(function, *args) ⇒ FunctionCall
Returns a new instance of FunctionCall.
5 6 7 8 |
# File 'lib/pgb/function_call.rb', line 5 def initialize(function, *args) @function = function.to_s.upcase @args = args.map { to_expression(_1) } end |
Instance Method Details
#to_sql ⇒ Object
10 11 12 |
# File 'lib/pgb/function_call.rb', line 10 def to_sql "#{function}(#{args.map(&:to_sql).join(', ')})" end |