module Rabbit::DirtyCount

Constants

TOO_DIRTY

Public Instance Methods

bit_dirty() click to toggle source
# File lib/rabbit/utils.rb, line 432
def bit_dirty
  dirty(0.01)
end
dirty(factor=0.1) click to toggle source
# File lib/rabbit/utils.rb, line 423
def dirty(factor=0.1)
  @dirty_count += TOO_DIRTY * factor
  dirtied if dirty?
end
dirty?() click to toggle source
# File lib/rabbit/utils.rb, line 419
def dirty?
  @dirty_count >= TOO_DIRTY
end
dirty_count_clean() click to toggle source
# File lib/rabbit/utils.rb, line 436
def dirty_count_clean
  @dirty_count = 0
end
very_dirty() click to toggle source
# File lib/rabbit/utils.rb, line 428
def very_dirty
  dirty(1)
end

Private Instance Methods

check_dirty() { || ... } click to toggle source
# File lib/rabbit/utils.rb, line 445
def check_dirty
  if dirty?
    dirtied
  else
    yield
  end
end
dirtied() click to toggle source
# File lib/rabbit/utils.rb, line 441
def dirtied
  dirty_count_clean
end