Sha256: 2dd55461de94458463e7de17529f8e71b7369835d853dec4549e51a6da7ea9ec
Contents?: true
Size: 462 Bytes
Versions: 10
Compression:
Stored size: 462 Bytes
Contents
module Restfulie::Client::Feature::History def snapshots @snapshots ||= [] end def max_to_remind 10 end def history(number) snapshots[snapshots.size + number] || raise("Undefined snapshot for #{number}, only containing #{@snapshots.size} snapshots.") end def make_snapshot(request) snapshots.shift if snapshot_full? snapshots << request end private def snapshot_full? snapshots.size >= max_to_remind end end
Version data entries
10 entries across 10 versions & 2 rubygems