vendredi 10 février 2017

How to pass command object to method?

I have a Command table which look like this in rails console

 Command(id: integer, created_at: datetime, updated_at: datetime, timeout: 
         integer, name: string, command: text, action: string, reboot_action:
         string, num_retries: integer, partnum: string, path: string,
         firmware: string)

The last command in the table look like this:

<Command id: 1486662250106112, created_at: "2017-02-09 17:44:10", 
         updated_at: "2017-02-09 17:44:10", timeout: 60, 
         name: "GET_HDD_FW", command: "/tmp/PXE_Scripts/Binaries/hdparm --yes-i-know-what-...", 
         action: "REBOOT_RETRY", reboot_action: nil, num_retries: 3,
         partnum: "ST3000NM0033-9ZM170", path: "hdd_sata_sc", firmware: nil>

So how to pass the command object to the method?

Aucun commentaire:

Enregistrer un commentaire