Class: Bugwatch::FeedbackSender
- Inherits:
-
Object
- Object
- Bugwatch::FeedbackSender
- Defined in:
- lib/bugwatch/feedback_sender.rb
Constant Summary collapse
- TIMEOUT =
3
Instance Method Summary collapse
- #deliver ⇒ Object
-
#initialize(message:, email: nil, name: nil, url: nil, issue_id: nil, metadata: {}, config: Bugwatch.configuration) ⇒ FeedbackSender
constructor
A new instance of FeedbackSender.
Constructor Details
#initialize(message:, email: nil, name: nil, url: nil, issue_id: nil, metadata: {}, config: Bugwatch.configuration) ⇒ FeedbackSender
Returns a new instance of FeedbackSender.
9 10 11 12 13 14 15 16 17 |
# File 'lib/bugwatch/feedback_sender.rb', line 9 def initialize(message:, email: nil, name: nil, url: nil, issue_id: nil, metadata: {}, config: Bugwatch.configuration) @message = @email = email @name = name @url = url @issue_id = issue_id @metadata = @config = config end |
Instance Method Details
#deliver ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/bugwatch/feedback_sender.rb', line 19 def deliver return unless @config.api_key return unless @config.endpoint Thread.new do post_feedback rescue StandardError # Fire-and-forget: never affect the host app end end |