Class: Errorgap::Transaction

Inherits:
Struct
  • Object
show all
Defined in:
lib/errorgap/transaction.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#duration_msObject

Returns the value of attribute duration_ms

Returns:

  • (Object)

    the current value of duration_ms



19
20
21
# File 'lib/errorgap/transaction.rb', line 19

def duration_ms
  @duration_ms
end

#environmentObject

Returns the value of attribute environment

Returns:

  • (Object)

    the current value of environment



19
20
21
# File 'lib/errorgap/transaction.rb', line 19

def environment
  @environment
end

#job_classObject

Returns the value of attribute job_class

Returns:

  • (Object)

    the current value of job_class



19
20
21
# File 'lib/errorgap/transaction.rb', line 19

def job_class
  @job_class
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



19
20
21
# File 'lib/errorgap/transaction.rb', line 19

def kind
  @kind
end

#methodObject

Returns the value of attribute method

Returns:

  • (Object)

    the current value of method



19
20
21
# File 'lib/errorgap/transaction.rb', line 19

def method
  @method
end

#occurred_atObject

Returns the value of attribute occurred_at

Returns:

  • (Object)

    the current value of occurred_at



19
20
21
# File 'lib/errorgap/transaction.rb', line 19

def occurred_at
  @occurred_at
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



19
20
21
# File 'lib/errorgap/transaction.rb', line 19

def path
  @path
end

#path_rawObject

Returns the value of attribute path_raw

Returns:

  • (Object)

    the current value of path_raw



19
20
21
# File 'lib/errorgap/transaction.rb', line 19

def path_raw
  @path_raw
end

#queueObject

Returns the value of attribute queue

Returns:

  • (Object)

    the current value of queue



19
20
21
# File 'lib/errorgap/transaction.rb', line 19

def queue
  @queue
end

#spansObject

Returns the value of attribute spans

Returns:

  • (Object)

    the current value of spans



19
20
21
# File 'lib/errorgap/transaction.rb', line 19

def spans
  @spans
end

#status_codeObject

Returns the value of attribute status_code

Returns:

  • (Object)

    the current value of status_code



19
20
21
# File 'lib/errorgap/transaction.rb', line 19

def status_code
  @status_code
end

Instance Method Details

#to_hObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/errorgap/transaction.rb', line 25

def to_h
  {
    kind: kind,
    method: method,
    path: path,
    path_raw: path_raw,
    status_code: status_code,
    duration_ms: duration_ms,
    environment: environment,
    occurred_at: occurred_at&.utc&.iso8601(3),
    spans: Array(spans).map(&:to_h),
    job_class: job_class,
    queue: queue
  }.compact
end