Module: Rabbit::DirtyCount

Included in:
Renderer::Base, Theme::Applier
Defined in:
lib/rabbit/utils.rb

Constant Summary collapse

TOO_DIRTY =
5

Instance Method Summary collapse

Instance Method Details

#bit_dirtyObject


432
433
434
# File 'lib/rabbit/utils.rb', line 432

def bit_dirty
  dirty(0.01)
end

#dirty(factor = 0.1) ⇒ Object


423
424
425
426
# File 'lib/rabbit/utils.rb', line 423

def dirty(factor=0.1)
  @dirty_count += TOO_DIRTY * factor
  dirtied if dirty?
end

#dirty?Boolean

Returns:

  • (Boolean)

419
420
421
# File 'lib/rabbit/utils.rb', line 419

def dirty?
  @dirty_count >= TOO_DIRTY
end

#dirty_count_cleanObject


436
437
438
# File 'lib/rabbit/utils.rb', line 436

def dirty_count_clean
  @dirty_count = 0
end

#very_dirtyObject


428
429
430
# File 'lib/rabbit/utils.rb', line 428

def very_dirty
  dirty(1)
end