Class: Cuprum::Collections::Basic::Commands::InsertOne
- Inherits:
-
Cuprum::Collections::Basic::Command
- Object
- Cuprum::Command
- Command
- Cuprum::Collections::Basic::Command
- Cuprum::Collections::Basic::Commands::InsertOne
- Defined in:
- lib/cuprum/collections/basic/commands/insert_one.rb
Overview
Command for inserting an entity into the collection.
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(entity: ) ⇒ Cuprum::Result<Hash>
Inserts the entity into the collection.
Methods inherited from Cuprum::Collections::Basic::Command
Constructor Details
This class inherits a constructor from Cuprum::Collections::Basic::Command
Instance Method Details
#call(entity: ) ⇒ Cuprum::Result<Hash>
Inserts the entity into the collection.
If the collection already includes an entity with the same primary key, #call will fail and the collection will not be updated.
21 22 23 24 |
# File 'lib/cuprum/collections/basic/commands/insert_one.rb', line 21 validate_parameters :call do keyword :entity, Stannum::Constraints::Types::HashWithStringKeys.new end |