lib/liquidscript/icr/context.rb in liquidscript-0.6.1 vs lib/liquidscript/icr/context.rb in liquidscript-0.6.2

- old
+ new

@@ -1,5 +1,7 @@ +require "hashie" + module Liquidscript module ICR # Handles variables within blocks. Each variable will get a # reference in each context. When retrieving the value of @@ -60,9 +62,18 @@ parent.get(name) else raise InvalidReferenceError.new(name) end end + end + + # Allows a specific variable to be used - but doesn't define it + # in the current context. + # + # @param name [Symbol] + # @return [void] + def allow(name) + allowed_variables << name end # All of the parameter variables. # # @return [Array<Variable>]