Class: Cuprum::Collections::Commands::FindOneMatching
- Inherits:
-
Cuprum::Command
- Object
- Cuprum::Command
- Cuprum::Collections::Commands::FindOneMatching
- Defined in:
- lib/cuprum/collections/commands/find_one_matching.rb
Overview
Command for finding a unique entity by a query or set of attributes.
Instance Attribute Summary collapse
-
#collection ⇒ #find_matching
readonly
The collection to query.
Instance Method Summary collapse
-
#initialize(collection:) ⇒ FindOneMatching
constructor
A new instance of FindOneMatching.
Constructor Details
#initialize(collection:) ⇒ FindOneMatching
Returns a new instance of FindOneMatching.
83 84 85 86 87 |
# File 'lib/cuprum/collections/commands/find_one_matching.rb', line 83 def initialize(collection:) super() @collection = collection end |
Instance Attribute Details
#collection ⇒ #find_matching (readonly)
Returns the collection to query.
90 91 92 |
# File 'lib/cuprum/collections/commands/find_one_matching.rb', line 90 def collection @collection end |