Class: Cuprum::Collections::Basic::Commands::DestroyOne
- Inherits:
-
Cuprum::Collections::Basic::Command
- Object
- Cuprum::Command
- Command
- Cuprum::Collections::Basic::Command
- Cuprum::Collections::Basic::Commands::DestroyOne
- Defined in:
- lib/cuprum/collections/basic/commands/destroy_one.rb
Overview
Command for destroying one collection item by primary key.
Instance Attribute Summary
Attributes inherited from Cuprum::Collections::Basic::Command
#collection_name, #data, #default_contract, #member_name, #options, #primary_key_name, #primary_key_type
Instance Method Summary collapse
-
#call(primary_key: ) ⇒ Cuprum::Result<Hash{String, Object}>
Finds and destroys the item with the given primary key.
Methods inherited from Cuprum::Collections::Basic::Command
Constructor Details
This class inherits a constructor from Cuprum::Collections::Basic::Command
Instance Method Details
#call(primary_key: ) ⇒ Cuprum::Result<Hash{String, Object}>
Finds and destroys the item with the given primary key.
The command will find the entity with the given primary key and remove it from the collection. If the entity is not found, the command will fail and return a NotFound error.
21 22 23 |
# File 'lib/cuprum/collections/basic/commands/destroy_one.rb', line 21 validate_parameters :call do keyword :primary_key, Object end |