class Frappuccino::ToggleProperty

Public Class Methods

new(first, switcher, second) click to toggle source
# File lib/frappuccino/property/toggle_property.rb, line 3
def initialize(first, switcher, second)
  @properties = [first, second]
  @current_index = 0

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

Public Instance Methods

now() click to toggle source
# File lib/frappuccino/property/toggle_property.rb, line 12
def now
  @properties[@current_index].now
end