Class: ExceptionNotifier::SimplepushNotifier
- Inherits:
-
BaseNotifier
- Object
- BaseNotifier
- ExceptionNotifier::SimplepushNotifier
- Defined in:
- lib/integrations/simplepush_notifier.rb
Defined Under Namespace
Classes: SimplepushExceptionEvent
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#default_options ⇒ Object
readonly
Returns the value of attribute default_options.
Instance Method Summary collapse
- #call(exception, options = {}) ⇒ Object
-
#initialize(options) ⇒ SimplepushNotifier
constructor
A new instance of SimplepushNotifier.
Constructor Details
#initialize(options) ⇒ SimplepushNotifier
Returns a new instance of SimplepushNotifier.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/integrations/simplepush_notifier.rb', line 10 def initialize() cred = Rails.application.credentials.simplepush if !cred Rails.logger.error "Simplepush credentials not found. Please add simplepush credentials to your credentials file." @client = nil return end @client = Simplepush.new(cred[:key], cred[:pass], cred[:salt]) @default_options = end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/integrations/simplepush_notifier.rb', line 8 def client @client end |
#default_options ⇒ Object (readonly)
Returns the value of attribute default_options.
8 9 10 |
# File 'lib/integrations/simplepush_notifier.rb', line 8 def @default_options end |
Instance Method Details
#call(exception, options = {}) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/integrations/simplepush_notifier.rb', line 23 def call(exception, = {}) if !@client event = SimplepushExceptionEvent.new(exception, .reverse_merge()) @client.send(event.formatted_title, event.formatted_body) end end |