Class: ForemanNetbox::SyncHost::SyncVirtualMachine::Validate
- Inherits:
-
Object
- Object
- ForemanNetbox::SyncHost::SyncVirtualMachine::Validate
- Includes:
- Interactor
- Defined in:
- app/interactors/foreman_netbox/sync_host/sync_virtual_machine/validate.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/interactors/foreman_netbox/sync_host/sync_virtual_machine/validate.rb', line 9 def call validator = ForemanNetbox::VirtualMachineContract.new.call(netbox_params) return if validator.success? = validator.errors . .map { |m| "#{m.path} #{m.text}" } .to_sentence context.fail!(error: _('Invalid Virtual Machine parameters: %s') % ) end |