multiton cache of fields - wraps fields and fieldpos map to save memory
# File lib/arrayfields.rb, line 24 def new fields @sets[fields] ||= super end
# File lib/arrayfields.rb, line 36 def initialize fields raise ArgumentError, "<#{ fields.inspect }> not inject-able" unless fields.respond_to? :inject @fieldpos = fields.inject({}) do |h, f| unless String === f or Symbol === f raise ArgumentError, "<#{ f.inspect }> neither String nor Symbol" end h[f] = h.size h end @fields = fields end
Generated with the Darkfish Rdoc Generator 2.