module Helios
  class RainbowEffect
    RED = [255,0,0]
    ORANGE = [255,127,0]
    YELLOW = [255,255,0]
    GREEN = [0,255,0]
    BLUE = [0,0,255]
    INDIGO = [75,0,130]
    VIOLET = [198,0,235]

    def initialize(args)
      lights = args.fetch('lights', [1, '..', 25])
      @lights = get_lights(lights)
    end

    def change!
      starting = [RED, ORANGE, YELLOW, GREEN, BLUE, INDIGO, VIOLET]
      @lights.last.times do
        colors = starting.dup

        @lights.each do |light|
          Lights[light] = colors.first
          colors.rotate!
        end

        starting.rotate!
        sleep 1
      end
    end
  end
end

module Helios
  class RainbowEffect < Effect
    RED = [255,0,0]
    ORANGE = [255,127,0]
    YELLOW = [255,255,0]
    GREEN = [0,255,0]
    BLUE = [0,0,255]
    INDIGO = [75,0,130]
    VIOLET = [198,0,235]

    def initialize(args)
      lights = args.fetch('lights', [1, '..', 25])
      @lights = get_lights(lights)
    end

    def change!
      starting = [RED, ORANGE, YELLOW, GREEN, BLUE, INDIGO, VIOLET]
      @lights.last.times do
        colors = starting.dup

        @lights.each do |light|
          Lights[light] = colors.first
          colors.rotate!
        end

        starting.rotate!
        sleep 1
      end
    end
  end
end

Add base class Effect to RainbowEffect
Add base class Effect to RainbowEffect
