Sha256: 6f04db4fe29c4df7de01a9bdfa3aa5b244840e15825e14a34c121f635ae9015c

Contents?: true

Size: 323 Bytes

Versions: 1

Compression:

Stored size: 323 Bytes

Contents

module Frappuccino
  class ToggleProperty < Property
    def initialize(first, switcher, second)
      @properties = [first, second]
      @current_index = 0

      switcher.on_value do
        @current_index = (@current_index + 1) % 2
      end
    end

    def now
      @properties[@current_index].now
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
frappuccino-0.3.0 lib/frappuccino/property/toggle_property.rb