Class: Ml::CandidatesCsvPresenter
- Inherits:
-
Object
- Object
- Ml::CandidatesCsvPresenter
- Defined in:
- app/presenters/ml/candidates_csv_presenter.rb
Constant Summary collapse
- CANDIDATE_ASSOCIATIONS =
[:latest_metrics, :params, :experiment].freeze
- TARGET_FILESIZE =
This file size limit is mainly to avoid the generation to hog resources from the server. The value is arbitrary can be update once we have better insight into usage.
2.megabytes
Instance Method Summary collapse
-
#initialize(candidates) ⇒ CandidatesCsvPresenter
constructor
A new instance of CandidatesCsvPresenter.
- #present ⇒ Object
Constructor Details
#initialize(candidates) ⇒ CandidatesCsvPresenter
Returns a new instance of CandidatesCsvPresenter.
10 11 12 |
# File 'app/presenters/ml/candidates_csv_presenter.rb', line 10 def initialize(candidates) @candidates = candidates end |
Instance Method Details
#present ⇒ Object
14 15 16 |
# File 'app/presenters/ml/candidates_csv_presenter.rb', line 14 def present CsvBuilder.new(@candidates, headers, CANDIDATE_ASSOCIATIONS).render(TARGET_FILESIZE) end |