lib/scope.rb in expressive-0.0.13 vs lib/scope.rb in expressive-0.0.14
- old
+ new
@@ -12,18 +12,22 @@
def add_lookup_table(lookup_table_name, lookups)
@lookups[lookup_table_name] = {} unless @lookups.include?(lookup_table_name)
@lookups[lookup_table_name].merge!(lookups)
end
- def add_lookup_function(lookup_function_name, passed_in_options, &func_proc)
+ def add_lookup_function(lookup_function_name, passed_in_options = {}, &func_proc)
@lookups[lookup_function_name] = [passed_in_options, func_proc]
end
def clear_lookup_tables
@lookups.clear
end
+ def include?(name)
+ @symbols.include?(name) or @lookups.include?(name)
+ end
+
def [](name)
@symbols[name] || @parent[name]
end
def []=(name, value)
@@ -81,10 +85,10 @@
if lookup_result.is_a?(Hash)
lookup_result[key]
elsif lookup_result.is_a?(Array)
options = lookup_result.first
the_proc = lookup_result.last
- the_proc.call(options, key)
+ the_proc.call(options, key, *cells[2..-1].map {|cell| cell.eval(scope)})
end
end
end
syntax('post') do |scope, cells|