Class: Truemail::Log::Event
- Inherits:
-
Object
- Object
- Truemail::Log::Event
- Defined in:
- lib/truemail/log/event.rb
Constant Summary collapse
- TRACKING_EVENTS =
{ all: %i[success unrecognized_error recognized_error], unrecognized_error: %i[unrecognized_error], recognized_error: %i[recognized_error], error: %i[unrecognized_error recognized_error] }.freeze
Instance Method Summary collapse
-
#initialize(event, validator_instance) ⇒ Event
constructor
A new instance of Event.
- #log_level ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(event, validator_instance) ⇒ Event
Returns a new instance of Event.
14 15 16 17 18 19 20 |
# File 'lib/truemail/log/event.rb', line 14 def initialize(event, validator_instance) validator_result = validator_instance.result @event = event @has_validation_errors = !validator_result.errors.empty? @successful_validation = validator_result.success @validation_smtp_debug = validator_result.smtp_debug end |
Instance Method Details
#log_level ⇒ Object
26 27 28 |
# File 'lib/truemail/log/event.rb', line 26 def log_level action_level_log.last end |
#valid? ⇒ Boolean
22 23 24 |
# File 'lib/truemail/log/event.rb', line 22 def valid? Truemail::Log::Event::TRACKING_EVENTS[event].include?(action_level_log.first) end |