Class: Cuprum::Collections::Basic::Commands::InsertOne
- Inherits:
-
Cuprum::Collections::Basic::Command
- Object
- Cuprum::Command
- CollectionCommand
- 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 CollectionCommand
Instance Method Summary collapse
-
#call(entity:) ⇒ Cuprum::Result<Hash>
Inserts the entity into the collection.
Methods inherited from Cuprum::Collections::Basic::Command
Methods inherited from CollectionCommand
#initialize, #name, #primary_key_name, #primary_key_type, #query, #singular_name
Constructor Details
This class inherits a constructor from Cuprum::Collections::CollectionCommand
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 |
# File 'lib/cuprum/collections/basic/commands/insert_one.rb', line 21 validate :entity |