Class: RfLogger::LogForNotification
- Inherits:
-
Object
- Object
- RfLogger::LogForNotification
- Defined in:
- lib/rf_logger/log_for_notification.rb
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
Instance Method Summary collapse
- #details ⇒ Object
-
#initialize(entry) ⇒ LogForNotification
constructor
A new instance of LogForNotification.
- #interpolated_configured_subject ⇒ Object
- #subject ⇒ Object
Constructor Details
#initialize(entry) ⇒ LogForNotification
Returns a new instance of LogForNotification.
4 5 6 7 8 9 |
# File 'lib/rf_logger/log_for_notification.rb', line 4 def initialize(entry) @actor = entry[:actor] @action = entry[:action] @metadata = entry[:metadata] @level = entry[:level] end |
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level.
3 4 5 |
# File 'lib/rf_logger/log_for_notification.rb', line 3 def level @level end |
Instance Method Details
#details ⇒ Object
16 17 18 |
# File 'lib/rf_logger/log_for_notification.rb', line 16 def details YAML.dump @metadata end |
#interpolated_configured_subject ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/rf_logger/log_for_notification.rb', line 20 def interpolated_configured_subject if subject = RfLogger.configuration.notification_subject %w(actor action level).each do |variable| subject = subject.gsub("{{#{variable}}}", instance_variable_get("@#{variable}")) end subject end end |
#subject ⇒ Object
11 12 13 14 |
# File 'lib/rf_logger/log_for_notification.rb', line 11 def subject interpolated_configured_subject || "#{@level.upcase}! (#{@actor}/#{@action})" end |