Class: Delayed::Plugins::Reporting::PrettyJsonJobFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/delayed-plugins-reporting/pretty_json_job_formatter.rb

Constant Summary collapse

INCLUDED_ATTRIBUTE_NAMES =
%i| priority attempts run_at locked_at queue created_at updated_at |
INCLUDED_METHOD_NAMES =
%i| max_attempts |

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes: INCLUDED_ATTRIBUTE_NAMES, methods: INCLUDED_METHOD_NAMES) ⇒ PrettyJsonJobFormatter

Returns a new instance of PrettyJsonJobFormatter.



9
10
11
12
# File 'lib/delayed-plugins-reporting/pretty_json_job_formatter.rb', line 9

def initialize(attributes: INCLUDED_ATTRIBUTE_NAMES, methods: INCLUDED_METHOD_NAMES)
  @included_attribute_names = attributes
  @included_method_names = methods
end

Instance Attribute Details

#included_attribute_namesObject (readonly)

Returns the value of attribute included_attribute_names.



6
7
8
# File 'lib/delayed-plugins-reporting/pretty_json_job_formatter.rb', line 6

def included_attribute_names
  @included_attribute_names
end

#included_method_namesObject (readonly)

Returns the value of attribute included_method_names.



7
8
9
# File 'lib/delayed-plugins-reporting/pretty_json_job_formatter.rb', line 7

def included_method_names
  @included_method_names
end

Instance Method Details

#format(job) ⇒ Object



14
15
16
# File 'lib/delayed-plugins-reporting/pretty_json_job_formatter.rb', line 14

def format(job)
  as_pretty_formatted_json(job)
end