Module: Etag

Defined in:
lib/svcbase/api/etag.rb

Overview

compute etag hashes based on ID and updated_at of all items passed

Class Method Summary collapse

Class Method Details

.weak_hash(*args) ⇒ Object



5
6
7
8
9
10
# File 'lib/svcbase/api/etag.rb', line 5

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