Class: Drudgery::Extractors::ActiveRecordExtractor
- Inherits:
-
Object
- Object
- Drudgery::Extractors::ActiveRecordExtractor
- Defined in:
- lib/drudgery/extractors/active_record_extractor.rb
Instance Method Summary collapse
- #extract ⇒ Object
-
#initialize(model) ⇒ ActiveRecordExtractor
constructor
A new instance of ActiveRecordExtractor.
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
#extract ⇒ Object
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 |