Class: Cuprum::Collections::Commands::Update
- Inherits:
-
Cuprum::Command
- Object
- Cuprum::Command
- Cuprum::Collections::Commands::Update
- Defined in:
- lib/cuprum/collections/commands/update.rb
Overview
Command for assigning, validating and updating an entity in a collection.
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
The collection used to store the entity.
-
#contract ⇒ Stannum::Constraint
readonly
The constraint used to validate the entity.
Instance Method Summary collapse
-
#initialize(collection:, contract: nil) ⇒ Update
constructor
A new instance of Update.
Constructor Details
#initialize(collection:, contract: nil) ⇒ Update
Returns a new instance of Update.
49 50 51 52 53 54 |
# File 'lib/cuprum/collections/commands/update.rb', line 49 def initialize(collection:, contract: nil) super() @collection = collection @contract = contract end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the collection used to store the entity.
57 58 59 |
# File 'lib/cuprum/collections/commands/update.rb', line 57 def collection @collection end |
#contract ⇒ Stannum::Constraint (readonly)
Returns the constraint used to validate the entity.
60 61 62 |
# File 'lib/cuprum/collections/commands/update.rb', line 60 def contract @contract end |