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.



44
45
46
# File 'lib/tire/model/import.rb', line 44

def index
  @index
end

#klassObject (readonly)

Returns the value of attribute klass.



44
45
46
# File 'lib/tire/model/import.rb', line 44

def klass
  @klass
end

#optionsObject (readonly)

Returns the value of attribute options.



44
45
46
# File 'lib/tire/model/import.rb', line 44

def options
  @options
end

Instance Method Details

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



45
46
47
48
49
# File 'lib/tire/model/import.rb', line 45

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