Class: ElasticNotifier::Notifier
- Inherits:
-
Object
- Object
- ElasticNotifier::Notifier
- Defined in:
- lib/elastic_notifier.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Notifier
constructor
A new instance of Notifier.
- #notify_error(exception, params = {}) ⇒ Object (also: #call)
Constructor Details
#initialize(options) ⇒ Notifier
Returns a new instance of Notifier.
15 16 17 18 19 20 21 22 |
# File 'lib/elastic_notifier.rb', line 15 def initialize() @repo ||= Elasticsearch::Persistence::Repository.new do client Elasticsearch::Client.new url: [:url] index .fetch(:index, :elastic_notifier) type .fetch(:type, :signals) end = end |
Instance Method Details
#notify_error(exception, params = {}) ⇒ Object Also known as: call
24 25 26 27 28 29 30 |
# File 'lib/elastic_notifier.rb', line 24 def notify_error(exception, params = {}) overrides = { program_name: [:program_name] }.merge(params) error = Error.new(exception, overrides).to_hash @repo.save(error) end |