Class: SpreeCmCommissioner::VotingLeaderboards::CalculateScore
- Inherits:
-
Object
- Object
- SpreeCmCommissioner::VotingLeaderboards::CalculateScore
- Includes:
- Spree::ServiceModule::Base
- Defined in:
- app/services/spree_cm_commissioner/voting_leaderboards/calculate_score.rb
Instance Method Summary collapse
-
#call(votes:, unique_voters:, max_votes: nil, max_unique_voters: nil, votes_weight: nil, voters_weight: nil) ⇒ Object
rubocop:disable Metrics/ParameterLists.
Instance Method Details
#call(votes:, unique_voters:, max_votes: nil, max_unique_voters: nil, votes_weight: nil, voters_weight: nil) ⇒ Object
rubocop:disable Metrics/ParameterLists
24 25 26 27 28 29 30 31 32 |
# File 'app/services/spree_cm_commissioner/voting_leaderboards/calculate_score.rb', line 24 def call(votes:, unique_voters:, max_votes: nil, max_unique_voters: nil, votes_weight: nil, voters_weight: nil) # rubocop:disable Metrics/ParameterLists scores = compute_all(votes, unique_voters, max_votes: max_votes, max_unique_voters: max_unique_voters, votes_weight: votes_weight, voters_weight: voters_weight ) success(scores) rescue StandardError => e failure(nil, e.) end |