Method: SQL::Maker#initialize
- Defined in:
- lib/sql/maker.rb
#initialize(args) ⇒ Maker
Returns a new instance of Maker.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/sql/maker.rb', line 17 def initialize(args) unless @driver = args[:driver].to_s.downcase croak(":driver is required for creating new instance of SQL::Maker") end unless @quote_char = args[:quote_char] @quote_char = if @driver == 'mysql' %q{`} else %q{"} end end @select_class = @driver == 'oracle' ? SQL::Maker::Select::Oracle : SQL::Maker::Select @name_sep = args[:name_sep] || '.' @new_line = args[:new_line] || "\n" @strict = args[:strict] || false @auto_bind = args[:auto_bind] || false # apply client-side prepared statement binding autocatically end |