Module: Rubino::API::Operations::CronJobs::Serializer

Defined in:
lib/rubino/api/operations/cron_jobs/list_operation.rb

Overview

Shared serializer used by every CronJobs operation so the wire shape (and the JSON-decoded skills array) stays consistent.

Class Method Summary collapse

Class Method Details

.call(job) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/rubino/api/operations/cron_jobs/list_operation.rb', line 34

def call(job)
  {
    id: job[:id],
    name: job[:name],
    schedule: job[:schedule],
    prompt: job[:prompt],
    skills: job[:skills_json] ? JSON.parse(job[:skills_json]) : [],
    model: job[:model],
    provider: job[:provider],
    deliver: job[:deliver],
    enabled: job[:enabled] == true,
    last_run_at: job[:last_run_at],
    last_run_id: job[:last_run_id],
    created_at: job[:created_at],
    updated_at: job[:updated_at]
  }
end