Class: RightSupport::Notifier::Notification
- Defined in:
- lib/right_support/notifiers/notification.rb
Overview
definition for a notification to be sent to notifiers.
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#component ⇒ Object
readonly
Returns the value of attribute component.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#error_token ⇒ Object
readonly
Returns the value of attribute error_token.
-
#global_session ⇒ Object
readonly
Returns the value of attribute global_session.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Instance Method Summary collapse
-
#initialize(error, options = {}) ⇒ Notification
constructor
A new instance of Notification.
Constructor Details
#initialize(error, options = {}) ⇒ Notification
Returns a new instance of Notification.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/right_support/notifiers/notification.rb', line 38 def initialize(error, = {}) = { error_token: nil, env: nil, payload: nil, global_session: nil, component: 'unknown', action: 'unknown', }.merge() @error = error @error_token = ([:error_token] || ::RightSupport::Data::Token.generate).to_s @env = ([:env] || {}).to_hash @payload = ([:payload] || {}).to_hash @global_session = ([:global_session] || {}).to_hash @component = [:component].to_s @action = [:action].to_s end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
27 28 29 |
# File 'lib/right_support/notifiers/notification.rb', line 27 def action @action end |
#component ⇒ Object (readonly)
Returns the value of attribute component.
27 28 29 |
# File 'lib/right_support/notifiers/notification.rb', line 27 def component @component end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
26 27 28 |
# File 'lib/right_support/notifiers/notification.rb', line 26 def env @env end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
26 27 28 |
# File 'lib/right_support/notifiers/notification.rb', line 26 def error @error end |
#error_token ⇒ Object (readonly)
Returns the value of attribute error_token.
26 27 28 |
# File 'lib/right_support/notifiers/notification.rb', line 26 def error_token @error_token end |
#global_session ⇒ Object (readonly)
Returns the value of attribute global_session.
26 27 28 |
# File 'lib/right_support/notifiers/notification.rb', line 26 def global_session @global_session end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
26 27 28 |
# File 'lib/right_support/notifiers/notification.rb', line 26 def payload @payload end |