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 finish auctions.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.call(attributes, &block) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/auction_fun_core/operations/auction_context/post_auction/participant_operation.rb', line 15 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) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/auction_fun_core/operations/auction_context/post_auction/participant_operation.rb', line 25 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 |