Class: Moose::Inventory::Operations::InventorySnapshotValidator
- Inherits:
-
Object
- Object
- Moose::Inventory::Operations::InventorySnapshotValidator
- Defined in:
- lib/moose_inventory/operations/inventory_snapshot_validator.rb
Overview
Normalizes and validates portable inventory snapshot input before import.
Instance Method Summary collapse
- #call(snapshot:) ⇒ Object
-
#initialize(context:) ⇒ InventorySnapshotValidator
constructor
A new instance of InventorySnapshotValidator.
Constructor Details
#initialize(context:) ⇒ InventorySnapshotValidator
Returns a new instance of InventorySnapshotValidator.
8 9 10 |
# File 'lib/moose_inventory/operations/inventory_snapshot_validator.rb', line 8 def initialize(context:) @context = context end |
Instance Method Details
#call(snapshot:) ⇒ Object
12 13 14 15 16 |
# File 'lib/moose_inventory/operations/inventory_snapshot_validator.rb', line 12 def call(snapshot:) normalized = deep_stringify_keys(snapshot) validate_snapshot!(normalized) normalized end |