Class: Drudgery::Extractors::ActiveRecordExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/drudgery/extractors/active_record_extractor.rb

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ ActiveRecordExtractor

Returns a new instance of ActiveRecordExtractor.



4
5
6
# File 'lib/drudgery/extractors/active_record_extractor.rb', line 4

def initialize(model)
  @model = model
end

Instance Method Details

#extractObject



8
9
10
11
12
# File 'lib/drudgery/extractors/active_record_extractor.rb', line 8

def extract
  @model.find_each do |record|
    yield record.attributes
  end
end