# File lib/jbuilder.rb, line 24 def initialize(*args) @format = ::ActiveSupport::OrderedHash.new @cache = {} options = args.extract_options! args.each do |name| @format[name] = [] end options.each do |name, paramaters| @format[name] = paramaters end end
# File lib/jbuilder.rb, line 41 def format(key) @cache[key] ||= @format.inject(key.to_s) do |result, args| func, args = args if ::Proc === func func.call result, *args else result.send func, *args end end end
# File lib/jbuilder.rb, line 37 def initialize_copy(original) @cache = {} end