module Tally::Calculator
Public Class Methods
new(day = Date.today)
click to toggle source
# File lib/tally/calculator.rb, line 12 def initialize(day = Date.today) @day = day end
Public Instance Methods
call()
click to toggle source
Override in sub class, this is what gets called when the calculator is run. This method is run in the background so it can take a while if needed to summarize data.
# File lib/tally/calculator.rb, line 19 def call raise NotImplementedError end
Private Instance Methods
record_scope()
click to toggle source
# File lib/tally/calculator.rb, line 25 def record_scope Record.where(day: day).includes(:recordable) end