Class: Anomonitor::Jobs::Row

Inherits:
Struct
  • Object
show all
Defined in:
lib/anomonitor/jobs/row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#detailObject

Returns the value of attribute detail

Returns:

  • (Object)

    the current value of detail



5
6
7
# File 'lib/anomonitor/jobs/row.rb', line 5

def detail
  @detail
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



5
6
7
# File 'lib/anomonitor/jobs/row.rb', line 5

def error
  @error
end

#failed_atObject

Returns the value of attribute failed_at

Returns:

  • (Object)

    the current value of failed_at



5
6
7
# File 'lib/anomonitor/jobs/row.rb', line 5

def failed_at
  @failed_at
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



5
6
7
# File 'lib/anomonitor/jobs/row.rb', line 5

def id
  @id
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



5
6
7
# File 'lib/anomonitor/jobs/row.rb', line 5

def name
  @name
end

#queueObject

Returns the value of attribute queue

Returns:

  • (Object)

    the current value of queue



5
6
7
# File 'lib/anomonitor/jobs/row.rb', line 5

def queue
  @queue
end

#run_atObject

Returns the value of attribute run_at

Returns:

  • (Object)

    the current value of run_at



5
6
7
# File 'lib/anomonitor/jobs/row.rb', line 5

def run_at
  @run_at
end

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



5
6
7
# File 'lib/anomonitor/jobs/row.rb', line 5

def source
  @source
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



5
6
7
# File 'lib/anomonitor/jobs/row.rb', line 5

def status
  @status
end

#tagsObject

Returns the value of attribute tags

Returns:

  • (Object)

    the current value of tags



5
6
7
# File 'lib/anomonitor/jobs/row.rb', line 5

def tags
  @tags
end

#tenantObject

Returns the value of attribute tenant

Returns:

  • (Object)

    the current value of tenant



5
6
7
# File 'lib/anomonitor/jobs/row.rb', line 5

def tenant
  @tenant
end

Instance Method Details

#detail_textObject



23
24
25
26
27
# File 'lib/anomonitor/jobs/row.rb', line 23

def detail_text
  return nil if detail.nil? || detail.empty?

  detail.map { |k, v| "#{k}: #{v}" }.join("\n")
end

#sort_atObject



19
20
21
# File 'lib/anomonitor/jobs/row.rb', line 19

def sort_at
  failed_at || run_at || Time.at(0)
end