Class: SimpleQuery::SetClause
- Inherits:
-
Object
- Object
- SimpleQuery::SetClause
- Defined in:
- lib/simple_query/clauses/set_clause.rb
Instance Method Summary collapse
-
#initialize(set_hash) ⇒ SetClause
constructor
A new instance of SetClause.
- #to_sql ⇒ Object
Constructor Details
#initialize(set_hash) ⇒ SetClause
Returns a new instance of SetClause.
5 6 7 |
# File 'lib/simple_query/clauses/set_clause.rb', line 5 def initialize(set_hash) @set_hash = set_hash end |
Instance Method Details
#to_sql ⇒ Object
9 10 11 12 13 |
# File 'lib/simple_query/clauses/set_clause.rb', line 9 def to_sql @set_hash.map do |col, val| "#{quote_column(col)} = #{quote_value(val)}" end.join(", ") end |