Class: AuctionFunCore::Operations::AuctionContext::PreAuction::AuctionStartReminderOperation
- Inherits:
-
Base
- Object
- Base
- AuctionFunCore::Operations::AuctionContext::PreAuction::AuctionStartReminderOperation
- Defined in:
- lib/auction_fun_core/operations/auction_context/pre_auction/auction_start_reminder_operation.rb
Overview
Operation class for sending a reminder email to a participant about the start of an auction.
Class Method Summary collapse
-
.call(attributes) {|Dry::Matcher::Evaluator| ... } ⇒ Dry::Matcher::Evaluator
Executes the auction start reminder operation with the provided attributes.
Instance Method Summary collapse
-
#call(attributes) ⇒ Dry::Monads::Result
Executes the auction start reminder operation.
Class Method Details
.call(attributes) {|Dry::Matcher::Evaluator| ... } ⇒ Dry::Matcher::Evaluator
Executes the auction start reminder operation with the provided attributes.
22 23 24 25 26 27 28 |
# File 'lib/auction_fun_core/operations/auction_context/pre_auction/auction_start_reminder_operation.rb', line 22 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 auction start reminder operation.
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/auction_fun_core/operations/auction_context/pre_auction/auction_start_reminder_operation.rb', line 36 def call(attributes) auction = yield validate_contract(attributes) participant_ids = yield collect_current_auction_participants(auction.id) bid_repository.transaction do |_t| participant_ids.each do |participant_id| yield send_auction_start_reminder_mailer_job(auction.id, participant_id) end end Success([auction, participant_ids]) end |