Class: Rnotifier::EventData
- Inherits:
-
Object
- Object
- Rnotifier::EventData
- Defined in:
- lib/rnotifier/event_data.rb
Constant Summary collapse
- EVENT =
0- ALERT =
1
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, type, data = {}) ⇒ EventData
constructor
A new instance of EventData.
- #notify ⇒ Object
Constructor Details
#initialize(name, type, data = {}) ⇒ EventData
Returns a new instance of EventData.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rnotifier/event_data.rb', line 8 def initialize(name, type, data = {}) @data = { :name => name, :data => data, :app_env => EventData.app_env, :occurred_at => Time.now.utc.to_s, :rnotifier_client => Config::CLIENT, :type => type, } @data[:context_data] = Thread.current[:rnotifier_context] if Thread.current[:rnotifier_context] end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/rnotifier/event_data.rb', line 3 def data @data end |
Class Method Details
.app_env ⇒ Object
29 30 31 |
# File 'lib/rnotifier/event_data.rb', line 29 def self.app_env @env ||= Rnotifier::Config.event_app_env end |