Class: Progression

Inherits:
Object
  • Object
show all
Defined in:
lib/progression.rb,
lib/progression/version.rb

Constant Summary collapse

VERSION =
"0.1.0"

Instance Method Summary collapse

Constructor Details

#initialize(count, current = 0) ⇒ Progression

Accept proc, tick



6
7
8
9
10
# File 'lib/progression.rb', line 6

def initialize(count, current = 0)
  @count = count
  @current = current
  @current_inner_tick = 0
end

Instance Method Details

#tickObject



12
13
14
15
16
17
18
19
20
# File 'lib/progression.rb', line 12

def tick
  ticks_per_bump = Calculator.ticks_per_bump(window_size, count)

  if ticks_per_bump > 1
    tick_more_elements_than_bars(ticks_per_bump)
  else
    tick_more_bars_than_elements(ticks_per_bump)
  end
end