lib/strike/interpreter.rb in strike-0.3.6 vs lib/strike/interpreter.rb in strike-0.4.0

- old
+ new

@@ -6,11 +6,11 @@ class Interpreter attr_reader :tables def initialize(table_source = nil) @table_source = table_source - @tables ||= Hash.new { |h, k| h[k] = -> { :keep } } + @tables ||= Hash.new { |h, k| h[k] = :keep } end # Parse the given profile and generate the tables defined in it. # # @param [String] profile the profile with the definitions. @@ -25,10 +25,10 @@ # @param [String, Symbol] name the name of the table. # @param [Proc] block the block to declare the definitions for the tables. def table(name, &block) table = table_source.call(&block) - @tables[name.to_sym] = table + @tables[name.to_sym] = table.call end def table_source @table_source ||= Strike::Table.public_method(:new) end