Class representing SQL scalar values
DERIVED FROM github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
# File lib/sqlobject.rb, line 143 def _escape ( val ) case val when String then "'#{_quoteString(val.to_s)}'" when true then 'TRUE' when false then 'FALSE' when nil then "NULL" when Numeric, Time then val.to_s when Symbol then "'#{_quoteString(val.to_s)}'" when Class then "'#{val.to_s}'" else "'#{quoteString( val.to_s )}'" end end
FROM github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb Quotes a string, escaping any ‘ (single quote) and \ (backslash) characters.
# File lib/sqlobject.rb, line 162 def _quoteString ( str ) str.gsub( /\\/, '\&\&' ).gsub( /'/, "''" ) # ' (for ruby-mode) end
Generated with the Darkfish Rdoc Generator 2.