Class: RakeAudit::TaskExecutionRecord

Inherits:
Struct
  • Object
show all
Defined in:
lib/rake_audit/task_execution_record.rb

Overview

Immutable data transfer object describing a single Rake task execution.

This Struct is the serialization boundary used by every storage adapter: adapters must rely on #to_h and never reach into internal state directly.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments

Returns:

  • (Object)

    the current value of arguments



8
9
10
# File 'lib/rake_audit/task_execution_record.rb', line 8

def arguments
  @arguments
end

#duration_msObject

Returns the value of attribute duration_ms

Returns:

  • (Object)

    the current value of duration_ms



8
9
10
# File 'lib/rake_audit/task_execution_record.rb', line 8

def duration_ms
  @duration_ms
end

#error_classObject

Returns the value of attribute error_class

Returns:

  • (Object)

    the current value of error_class



8
9
10
# File 'lib/rake_audit/task_execution_record.rb', line 8

def error_class
  @error_class
end

#error_messageObject

Returns the value of attribute error_message

Returns:

  • (Object)

    the current value of error_message



8
9
10
# File 'lib/rake_audit/task_execution_record.rb', line 8

def error_message
  @error_message
end

#finished_atObject

Returns the value of attribute finished_at

Returns:

  • (Object)

    the current value of finished_at



8
9
10
# File 'lib/rake_audit/task_execution_record.rb', line 8

def finished_at
  @finished_at
end

#hostnameObject

Returns the value of attribute hostname

Returns:

  • (Object)

    the current value of hostname



8
9
10
# File 'lib/rake_audit/task_execution_record.rb', line 8

def hostname
  @hostname
end

#pidObject

Returns the value of attribute pid

Returns:

  • (Object)

    the current value of pid



8
9
10
# File 'lib/rake_audit/task_execution_record.rb', line 8

def pid
  @pid
end

#rails_envObject

Returns the value of attribute rails_env

Returns:

  • (Object)

    the current value of rails_env



8
9
10
# File 'lib/rake_audit/task_execution_record.rb', line 8

def rails_env
  @rails_env
end

#ruby_versionObject

Returns the value of attribute ruby_version

Returns:

  • (Object)

    the current value of ruby_version



8
9
10
# File 'lib/rake_audit/task_execution_record.rb', line 8

def ruby_version
  @ruby_version
end

#started_atObject

Returns the value of attribute started_at

Returns:

  • (Object)

    the current value of started_at



8
9
10
# File 'lib/rake_audit/task_execution_record.rb', line 8

def started_at
  @started_at
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



8
9
10
# File 'lib/rake_audit/task_execution_record.rb', line 8

def status
  @status
end

#task_nameObject

Returns the value of attribute task_name

Returns:

  • (Object)

    the current value of task_name



8
9
10
# File 'lib/rake_audit/task_execution_record.rb', line 8

def task_name
  @task_name
end

Instance Method Details

#to_hHash{Symbol=>Object}

The canonical, adapter-facing serialization of this record.

Always returns a plain Hash containing all 12 fields, regardless of how the record was constructed. Adapters depend on this exact contract.

Returns:

  • (Hash{Symbol=>Object})


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/rake_audit/task_execution_record.rb', line 29

def to_h
  {
    task_name: task_name,
    arguments: arguments,
    started_at: started_at,
    finished_at: finished_at,
    duration_ms: duration_ms,
    status: status,
    error_class: error_class,
    error_message: error_message,
    hostname: hostname,
    pid: pid,
    ruby_version: ruby_version,
    rails_env: rails_env
  }
end