Class: AuctionFunCore::Operations::AuctionContext::PostAuction::ParticipantOperation
- Inherits:
-
Base
- Object
- Base
- AuctionFunCore::Operations::AuctionContext::PostAuction::ParticipantOperation
- Defined in:
- lib/auction_fun_core/operations/auction_context/post_auction/participant_operation.rb
Overview
Operation class for managing participants in auctions.
Class Method Summary collapse
-
.call(attributes) {|Dry::Matcher::Evaluator| ... } ⇒ Dry::Matcher::Evaluator
Executes the participant operation with the provided attributes.
Instance Method Summary collapse
-
#call(attributes) ⇒ Dry::Monads::Result
Executes the participant operation.
Class Method Details
.call(attributes) {|Dry::Matcher::Evaluator| ... } ⇒ Dry::Matcher::Evaluator
Executes the participant operation with the provided attributes.
31 32 33 34 35 36 37 |
# File 'lib/auction_fun_core/operations/auction_context/post_auction/participant_operation.rb', line 31 def self.call(attributes, &block) operation = new.call(attributes) return operation unless block Dry::Matcher::ResultMatcher.call(operation, &block) end |
Instance Method Details
#call(attributes) ⇒ Dry::Monads::Result
Executes the participant operation.
45 46 47 48 49 50 51 52 53 |
# File 'lib/auction_fun_core/operations/auction_context/post_auction/participant_operation.rb', line 45 def call(attributes) auction, participant = yield validate_contract(attributes) user_repository.transaction do |_t| yield send_participant_email_with_statistics_and_payment_instructions(auction.id, participant.id) end Success([auction, participant]) end |