Module: Webhookdb::Service::Entities::EtaggedMixin
- Defined in:
- lib/webhookdb/service/entities.rb
Overview
Instance Method Summary collapse
Instance Method Details
#to_json ⇒ Object
86 87 88 89 90 91 |
# File 'lib/webhookdb/service/entities.rb', line 86 def to_json(*) serialized = super raise TypeError, "EtaggedMixin can only be used for object entities" unless serialized[-1] == "}" etag = Digest::MD5.hexdigest(Webhookdb::COMMIT.to_s + serialized) return serialized[...-1] + ",\"etag\":\"#{etag}\"}" end |