module Neoclock

Constants

VERSION

Public Class Methods

blender(start, stop, sixtieth) click to toggle source
# File lib/neoclock.rb, line 11
def self.blender start, stop, sixtieth
  c = []
  start.each_with_index do |component, i|
    c.push intersperse(component, stop[i], sixtieth)
  end
  c
end
intersperse(first, second, sixtieth) click to toggle source
# File lib/neoclock.rb, line 19
def self.intersperse first, second, sixtieth
  lower, higher = first, second
  if second < first
    lower, higher = second, first
    sixtieth = 60 - sixtieth
  end
  ((higher - lower) / 60.0 * sixtieth).to_i + lower
end