Class: ForemanNetbox::SyncHost::SyncDevice::Validate
- Inherits:
-
Object
- Object
- ForemanNetbox::SyncHost::SyncDevice::Validate
- Includes:
- Interactor
- Defined in:
- app/interactors/foreman_netbox/sync_host/sync_device/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_device/validate.rb', line 9 def call validator = ForemanNetbox::DeviceContract.new.call(netbox_params) return if validator.success? = validator.errors . .map { |m| "#{m.path} #{m.text}" } .to_sentence context.fail!(error: _('Invalid Device parameters: %s') % ) end |