Module: Tire::Model::Import::Strategy::Base

Included in:
ActiveRecord, Default, Kaminari, Mongoid, WillPaginate
Defined in:
lib/tire/model/import.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



48
49
50
# File 'lib/tire/model/import.rb', line 48

def index
  @index
end

#klassObject (readonly)

Returns the value of attribute klass.



48
49
50
# File 'lib/tire/model/import.rb', line 48

def klass
  @klass
end

#optionsObject (readonly)

Returns the value of attribute options.



48
49
50
# File 'lib/tire/model/import.rb', line 48

def options
  @options
end

Instance Method Details

#initialize(klass, options = {}) ⇒ Object



49
50
51
52
53
# File 'lib/tire/model/import.rb', line 49

def initialize(klass, options={})
  @klass   = klass
  @options = {:per_page => 1000}.update(options)
  @index   = options[:index] ? Tire::Index.new(options.delete(:index)) : klass.tire.index
end