Class: MassInsert::Adapters::AbstractAdapter

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/mass_insert/adapters/abstract_adapter.rb

Direct Known Subclasses

Mysql2Adapter, PostgreSQLAdapter, SQLite3Adapter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values, options) ⇒ AbstractAdapter

Returns a new instance of AbstractAdapter.



6
7
8
9
10
# File 'lib/mass_insert/adapters/abstract_adapter.rb', line 6

def initialize(values, options)
  super(options.fetch(:class_name))
  @values  = values
  @options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/mass_insert/adapters/abstract_adapter.rb', line 4

def options
  @options
end

#valuesObject

Returns the value of attribute values.



4
5
6
# File 'lib/mass_insert/adapters/abstract_adapter.rb', line 4

def values
  @values
end

Instance Method Details

#to_sqlObject



12
13
14
# File 'lib/mass_insert/adapters/abstract_adapter.rb', line 12

def to_sql
  "#{insert_sql} #{values_sql};"
end