Sha256: 0abdd86c56b1a11ae2709d41ac211813d8da5b8eaa0ad36019b90a9606f20872
Contents?: true
Size: 288 Bytes
Versions: 3
Compression:
Stored size: 288 Bytes
Contents
# frozen_string_literal: true # compute etag hashes based on ID and updated_at of all items passed module Etag def self.weak_hash(*args) val = args.flatten.compact.map do |item| item.id.to_s + item.updated_at.to_i.to_s end.join "W/\"#{val.to_i.to_s(32)}\"" end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
svcbase-0.1.18 | lib/svcbase/api/etag.rb |
svcbase-0.1.17 | lib/svcbase/api/etag.rb |
svcbase-0.1.16 | lib/svcbase/api/etag.rb |