Class: ActiveRecordPostgresRecovery::RecoveryEvent

Inherits:
Struct
  • Object
show all
Defined in:
lib/active_record_postgres_recovery/recovery_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#clear_actionObject

Returns the value of attribute clear_action

Returns:

  • (Object)

    the current value of clear_action



4
5
6
# File 'lib/active_record_postgres_recovery/recovery_event.rb', line 4

def clear_action
  @clear_action
end

#contextObject

Returns the value of attribute context

Returns:

  • (Object)

    the current value of context



4
5
6
# File 'lib/active_record_postgres_recovery/recovery_event.rb', line 4

def context
  @context
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



4
5
6
# File 'lib/active_record_postgres_recovery/recovery_event.rb', line 4

def error
  @error
end

#matched_errorObject

Returns the value of attribute matched_error

Returns:

  • (Object)

    the current value of matched_error



4
5
6
# File 'lib/active_record_postgres_recovery/recovery_event.rb', line 4

def matched_error
  @matched_error
end

#outcomeObject

Returns the value of attribute outcome

Returns:

  • (Object)

    the current value of outcome



4
5
6
# File 'lib/active_record_postgres_recovery/recovery_event.rb', line 4

def outcome
  @outcome
end

#retryingObject

Returns the value of attribute retrying

Returns:

  • (Object)

    the current value of retrying



4
5
6
# File 'lib/active_record_postgres_recovery/recovery_event.rb', line 4

def retrying
  @retrying
end

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



4
5
6
# File 'lib/active_record_postgres_recovery/recovery_event.rb', line 4

def source
  @source
end

Instance Method Details

#to_hObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/active_record_postgres_recovery/recovery_event.rb', line 14

def to_h
  {
    outcome: outcome,
    source: source,
    context: context,
    retrying: retrying,
    clear_strategy: clear_action[:strategy],
    clear_performed: clear_action[:performed],
    cleared_roles: clear_action[:roles],
    clear_skipped_reason: clear_action[:skipped_reason],
    matched_error_class: matched_error.class.name,
    matched_error_message: matched_error.message.to_s.lines.first.to_s.strip
  }
end