Class: SpreeCmCommissioner::VoteCounters::PerContestantCounter
- Defined in:
- app/services/spree_cm_commissioner/vote_counters/per_contestant_counter.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from SpreeCmCommissioner::VoteCounters::Base
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/services/spree_cm_commissioner/vote_counters/per_contestant_counter.rb', line 14 def call ids = contestant_ids return {} if ids.empty? with_redis do |redis| values = redis.mget(*ids.map { |id| vote_key(id) }) ids.zip(values).to_h { |id, v| [id, v.to_i] } end end |