Class: SourceMonitor::Fetching::FeedFetcher::FailureOutcome
- Inherits:
-
Object
- Object
- SourceMonitor::Fetching::FeedFetcher::FailureOutcome
- Defined in:
- lib/source_monitor/fetching/feed_fetcher/failure_outcome.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#retry_decision ⇒ Object
readonly
Returns the value of attribute retry_decision.
Instance Method Summary collapse
- #apply(source_updater:, started_at:, instrumentation_payload:) ⇒ Object
- #body ⇒ Object
- #feed ⇒ Object
-
#initialize(error:) ⇒ FailureOutcome
constructor
A new instance of FailureOutcome.
- #item_processing ⇒ Object
- #response ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(error:) ⇒ FailureOutcome
Returns a new instance of FailureOutcome.
7 8 9 |
# File 'lib/source_monitor/fetching/feed_fetcher/failure_outcome.rb', line 7 def initialize(error:) @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
11 12 13 |
# File 'lib/source_monitor/fetching/feed_fetcher/failure_outcome.rb', line 11 def error @error end |
#retry_decision ⇒ Object (readonly)
Returns the value of attribute retry_decision.
11 12 13 |
# File 'lib/source_monitor/fetching/feed_fetcher/failure_outcome.rb', line 11 def retry_decision @retry_decision end |
Instance Method Details
#apply(source_updater:, started_at:, instrumentation_payload:) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/source_monitor/fetching/feed_fetcher/failure_outcome.rb', line 13 def apply(source_updater:, started_at:, instrumentation_payload:) duration_ms = source_updater.elapsed_ms(started_at) @retry_decision = update_source(source_updater, duration_ms) create_fetch_log(source_updater, duration_ms, started_at) apply_instrumentation(instrumentation_payload) result end |
#body ⇒ Object
29 30 31 |
# File 'lib/source_monitor/fetching/feed_fetcher/failure_outcome.rb', line 29 def body response&.body end |
#feed ⇒ Object
33 34 35 |
# File 'lib/source_monitor/fetching/feed_fetcher/failure_outcome.rb', line 33 def feed nil end |
#item_processing ⇒ Object
37 38 39 |
# File 'lib/source_monitor/fetching/feed_fetcher/failure_outcome.rb', line 37 def item_processing @item_processing ||= EntryProcessingResult.empty end |
#response ⇒ Object
25 26 27 |
# File 'lib/source_monitor/fetching/feed_fetcher/failure_outcome.rb', line 25 def response error.response end |
#status ⇒ Object
21 22 23 |
# File 'lib/source_monitor/fetching/feed_fetcher/failure_outcome.rb', line 21 def status :failed end |