Class: ClickSession::StatusReporter
- Inherits:
-
Object
- Object
- ClickSession::StatusReporter
- Defined in:
- lib/click_session/status_reporter.rb
Direct Known Subclasses
Constant Summary collapse
- MAX_WEBHOOK_ATTEMPTS =
5
Instance Method Summary collapse
-
#initialize(webhook) ⇒ StatusReporter
constructor
A new instance of StatusReporter.
- #report(click_session) ⇒ Object
Constructor Details
#initialize(webhook) ⇒ StatusReporter
Returns a new instance of StatusReporter.
6 7 8 |
# File 'lib/click_session/status_reporter.rb', line 6 def initialize(webhook) @webhook = webhook end |
Instance Method Details
#report(click_session) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/click_session/status_reporter.rb', line 12 def report(click_session) @click_session = click_session begin webhook.call( ) @click_session.reported_back! notifier.session_reported(@click_session) rescue StandardError => e notifier.rescued_error(e) handle_webhook_failure end end |