|
|
|
|
|
3class PetitionsCSVPresenter
|
|
4 attr_reader :petitions, :presenter_class
|
|
|
|
6 def initialize(petitions, presenter_class: PetitionCSVPresenter)
|
|
7 @petitions, @presenter_class = petitions, presenter_class
|
|
|
|
|
- DuplicateMethodCall - calls 'presenter_class.fields' 2 times » reek
- NestedIterators - contains iterators nested 2 deep » reek
- Complexity 3 » saikuro
|
|
|
11 Enumerator.new do |stream|
|
|
12 stream << CSV::Row.new(presenter_class.fields, presenter_class.fields, true).to_s
|
|
|
|
14 petitions.in_batches do |petition|
|
|
15 stream << presenter_class.new(petition).to_csv
|
|
|
|
|
|
|
|
|