Module: Weathercock::Scorable
- Defined in:
- lib/weathercock/scorable.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #hit(event, increment: 1) ⇒ Object
- #hit_count(event, **window) ⇒ Object
- #rank(event, **window) ⇒ Object
- #remove_hits(event) ⇒ Object
Class Method Details
.included(base) ⇒ Object
5 6 7 |
# File 'lib/weathercock/scorable.rb', line 5 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#hit(event, increment: 1) ⇒ Object
23 24 25 |
# File 'lib/weathercock/scorable.rb', line 23 def hit(event, increment: 1) self.class.weathercock_scorer.hit(id, event, increment: increment) end |
#hit_count(event, **window) ⇒ Object
27 28 29 |
# File 'lib/weathercock/scorable.rb', line 27 def hit_count(event, **window) self.class.weathercock_scorer.hit_count(id, event, **window) end |
#rank(event, **window) ⇒ Object
31 32 33 |
# File 'lib/weathercock/scorable.rb', line 31 def rank(event, **window) self.class.weathercock_scorer.rank(id, event, **window) end |
#remove_hits(event) ⇒ Object
35 36 37 |
# File 'lib/weathercock/scorable.rb', line 35 def remove_hits(event) self.class.weathercock_scorer.remove_hits(id, event) end |