class Frappuccino::Property

Public Class Methods

new(zero, stream = nil) click to toggle source
# File lib/frappuccino/property.rb, line 12
def initialize(zero, stream = nil)
  @value = zero

  if stream
    stream.on_value do |value|
      @value = value
    end
  end
end

Public Instance Methods

map(&blk) click to toggle source
# File lib/frappuccino/property.rb, line 40
def map(&blk)
  MapProperty.new(self, &blk)
end
now() click to toggle source
# File lib/frappuccino/property.rb, line 22
def now
  @value
end
sample(stream) click to toggle source
# File lib/frappuccino/property.rb, line 26
def sample(stream)
  stream.map do
    self.now
  end
end
toggle(stream, property) click to toggle source
# File lib/frappuccino/property.rb, line 36
def toggle(stream, property)
  ToggleProperty.new(self, stream, property)
end
until(stream, property) click to toggle source
# File lib/frappuccino/property.rb, line 32
def until(stream, property)
  UntilProperty.new(self, stream, property)
end