Class: SourceMonitor::Scraping::BulkResultPresenter
- Inherits:
-
Object
- Object
- SourceMonitor::Scraping::BulkResultPresenter
- Defined in:
- lib/source_monitor/scraping/bulk_result_presenter.rb
Overview
Presenter for building flash messages from BulkSourceScraper results Extracts complex message formatting logic from the controller
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(result:) ⇒ BulkResultPresenter
constructor
A new instance of BulkResultPresenter.
- #to_flash_payload ⇒ Object
Constructor Details
#initialize(result:) ⇒ BulkResultPresenter
Returns a new instance of BulkResultPresenter.
10 11 12 |
# File 'lib/source_monitor/scraping/bulk_result_presenter.rb', line 10 def initialize(result:) @result = result end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
8 9 10 |
# File 'lib/source_monitor/scraping/bulk_result_presenter.rb', line 8 def result @result end |
Instance Method Details
#to_flash_payload ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/source_monitor/scraping/bulk_result_presenter.rb', line 14 def to_flash_payload case result.status when :success build_success_payload when :partial build_partial_payload else build_error_payload end end |