Top Level Namespace

Defined Under Namespace

Classes: Fixnum, Reac, String

Instance Method Summary collapse

Instance Method Details

#Reac(obj = nil, &block) ⇒ Object

construct reactive value from normal value (or proc)



86
87
88
89
90
91
92
93
94
95
96
# File 'lib/reac.rb', line 86

def Reac(obj=nil, &block)
  if block
    Reac::Proc.new(block)
  else
    if obj.is_a?(Array)
      Reac::Array.new(obj)
    else
      Reac::Value.new(obj)
    end
  end
end