Class: SourceMonitor::Fetching::FeedFetcher::SuccessOutcome
- Inherits:
-
Object
- Object
- SourceMonitor::Fetching::FeedFetcher::SuccessOutcome
- Defined in:
- lib/source_monitor/fetching/feed_fetcher/success_outcome.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#content_changed ⇒ Object
readonly
Returns the value of attribute content_changed.
-
#entries_digest ⇒ Object
readonly
Returns the value of attribute entries_digest.
-
#feed ⇒ Object
readonly
Returns the value of attribute feed.
-
#feed_signature ⇒ Object
readonly
Returns the value of attribute feed_signature.
-
#item_processing ⇒ Object
readonly
Returns the value of attribute item_processing.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #apply(source_updater:, started_at:, instrumentation_payload:) ⇒ Object
- #error ⇒ Object
-
#initialize(response:, body:, feed:, item_processing:, feed_signature:, content_changed:, entries_digest:) ⇒ SuccessOutcome
constructor
A new instance of SuccessOutcome.
- #result ⇒ Object
- #retry_decision ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(response:, body:, feed:, item_processing:, feed_signature:, content_changed:, entries_digest:) ⇒ SuccessOutcome
Returns a new instance of SuccessOutcome.
7 8 9 10 11 12 13 14 15 |
# File 'lib/source_monitor/fetching/feed_fetcher/success_outcome.rb', line 7 def initialize(response:, body:, feed:, item_processing:, feed_signature:, content_changed:, entries_digest:) @response = response @body = body @feed = feed @item_processing = item_processing @feed_signature = feed_signature @content_changed = content_changed @entries_digest = entries_digest end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
17 18 19 |
# File 'lib/source_monitor/fetching/feed_fetcher/success_outcome.rb', line 17 def body @body end |
#content_changed ⇒ Object (readonly)
Returns the value of attribute content_changed.
17 18 19 |
# File 'lib/source_monitor/fetching/feed_fetcher/success_outcome.rb', line 17 def content_changed @content_changed end |
#entries_digest ⇒ Object (readonly)
Returns the value of attribute entries_digest.
17 18 19 |
# File 'lib/source_monitor/fetching/feed_fetcher/success_outcome.rb', line 17 def entries_digest @entries_digest end |
#feed ⇒ Object (readonly)
Returns the value of attribute feed.
17 18 19 |
# File 'lib/source_monitor/fetching/feed_fetcher/success_outcome.rb', line 17 def feed @feed end |
#feed_signature ⇒ Object (readonly)
Returns the value of attribute feed_signature.
17 18 19 |
# File 'lib/source_monitor/fetching/feed_fetcher/success_outcome.rb', line 17 def feed_signature @feed_signature end |
#item_processing ⇒ Object (readonly)
Returns the value of attribute item_processing.
17 18 19 |
# File 'lib/source_monitor/fetching/feed_fetcher/success_outcome.rb', line 17 def item_processing @item_processing end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
17 18 19 |
# File 'lib/source_monitor/fetching/feed_fetcher/success_outcome.rb', line 17 def response @response end |
Instance Method Details
#apply(source_updater:, started_at:, instrumentation_payload:) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/source_monitor/fetching/feed_fetcher/success_outcome.rb', line 19 def apply(source_updater:, started_at:, instrumentation_payload:) duration_ms = source_updater.elapsed_ms(started_at) update_source(source_updater, duration_ms) create_fetch_log(source_updater, duration_ms, started_at) apply_instrumentation(instrumentation_payload) result end |
#error ⇒ Object
31 32 33 |
# File 'lib/source_monitor/fetching/feed_fetcher/success_outcome.rb', line 31 def error nil end |
#result ⇒ Object
39 40 41 |
# File 'lib/source_monitor/fetching/feed_fetcher/success_outcome.rb', line 39 def result Result.new(status: status, feed: feed, response: response, body: body, item_processing: item_processing, outcome: self) end |
#retry_decision ⇒ Object
35 36 37 |
# File 'lib/source_monitor/fetching/feed_fetcher/success_outcome.rb', line 35 def retry_decision nil end |
#status ⇒ Object
27 28 29 |
# File 'lib/source_monitor/fetching/feed_fetcher/success_outcome.rb', line 27 def status :fetched end |