Class: SQLStatement::Function

Inherits:
String
  • Object
show all
Defined in:
lib/sql/statement.rb

Overview

This class is used to represent complex SQL expressions, so that queries can return expressions. This is also meant to be used for conditions in a WHERE clause. There are no utility classes for generating these (even though they’ll probably include field names and other kinds of values), but for convenience, they can be generated with Kernel#SQLFunc.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(val = "", placeheld = []) ⇒ Function



120
121
122
123
# File 'lib/sql/statement.rb', line 120

def initialize(val="",placeheld=[])
   super
   @placeheld=placeheld
end

Instance Attribute Details

#placeheldObject

you need to manually keep this list of values for placeholders in sync with the actual string contained in this expression.



127
128
129
# File 'lib/sql/statement.rb', line 127

def placeheld
  @placeheld
end

Instance Method Details

#to_sqlpartObject



129
130
131
# File 'lib/sql/statement.rb', line 129

def to_sqlpart
   self
end