class Akane::Recorder::RoundrobinFlags
Public Class Methods
new(size)
click to toggle source
# File lib/akane/recorder.rb, line 115 def initialize(size) @hash = {} @limit_size = size end
Public Instance Methods
[](k)
click to toggle source
# File lib/akane/recorder.rb, line 120 def [](k) @hash[k] end
flag!(k)
click to toggle source
# File lib/akane/recorder.rb, line 124 def flag!(k) @hash[k] = true if @limit_size < @hash.size @hash.keys.first(@hash.size-@limit_size).each do |overflowed_key| @hash.delete overflowed_key end end nil end
flags()
click to toggle source
# File lib/akane/recorder.rb, line 138 def flags @hash.keys end
unflag!(k)
click to toggle source
# File lib/akane/recorder.rb, line 134 def unflag!(k) @hash.delete k end