lib/handlebars/context.rb in handlebars-0.3.2beta2 vs lib/handlebars/context.rb in handlebars-0.3.2beta3
- old
+ new
@@ -41,10 +41,28 @@
def handlebars
@js.require('handlebars/base')
end
+ def runtime
+ @js.runtime
+ end
+
+ def []=(key, value)
+ data[key] = value
+ end
+
+ def [](key)
+ data[key]
+ end
+
class << self
attr_accessor :current
+ end
+
+ private
+
+ def data
+ handlebars[:_rubydata] ||= @js.new_object
end
end
end
\ No newline at end of file