Class: ExceptionNotifier::GitlabNotifier
- Inherits:
-
Object
- Object
- ExceptionNotifier::GitlabNotifier
- Defined in:
- lib/gitlab_exception_notification/gitlab_notifier.rb
Instance Method Summary collapse
- #call(exception, options = {}) ⇒ Object
- #exception_notification(env, exception, options = {}) ⇒ Object
-
#initialize(options) ⇒ GitlabNotifier
constructor
A new instance of GitlabNotifier.
Constructor Details
#initialize(options) ⇒ GitlabNotifier
Returns a new instance of GitlabNotifier.
5 6 7 8 |
# File 'lib/gitlab_exception_notification/gitlab_notifier.rb', line 5 def initialize() puts "On init, options => #{.inspect}" @options = end |
Instance Method Details
#call(exception, options = {}) ⇒ Object
20 21 22 23 24 |
# File 'lib/gitlab_exception_notification/gitlab_notifier.rb', line 20 def call(exception, ={}) puts "On call, exception => #{exception.inspect}, options => #{.inspect}" env = [:env] || {} exception_notification(env, exception, @options.merge()) end |
#exception_notification(env, exception, options = {}) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/gitlab_exception_notification/gitlab_notifier.rb', line 11 def exception_notification(env, exception, ={}) issue = GitlabExceptionNotification::Issue.new(env, exception, ) if issue_id = issue.exists? issue.update(issue_id) else issue.create end end |