Method: LucaBook::Dict.checksum

Defined in:
lib/luca_book/dict.rb

.checksum(start_date, end_date) ⇒ Object



189
190
191
192
193
194
195
# File 'lib/luca_book/dict.rb', line 189

def self.checksum(start_date, end_date)
  digest = update_digest(String.new, File.read(latest_balance_path(start_date)))
  term_by_month(start_date, end_date)
    .map { |date| dir_digest(date.year, date.month) }
    .each { |month_digest| digest = update_digest(digest, month_digest) }
  digest
end