method
new
new(source, identifier, handler, format: nil, variant: nil, locals: nil, virtual_path: nil, updated_at: nil)
public
Hide source
# File actionview/lib/action_view/template.rb, line 130 def initialize(source, identifier, handler, format: nil, variant: nil, locals: nil, virtual_path: nil, updated_at: nil) unless locals ActiveSupport::Deprecation.warn "ActionView::Template#initialize requires a locals parameter" locals = [] end @source = source @identifier = identifier @handler = handler @compiled = false @locals = locals @virtual_path = virtual_path @variable = if @virtual_path base = @virtual_path[-1] == "/" ? "" : ::File.basename(@virtual_path) base =~ /\A_?(.*?)(?:\.\w+)*\z/ $1.to_sym end if updated_at ActiveSupport::Deprecation.warn "ActionView::Template#updated_at is deprecated" @updated_at = updated_at else @updated_at = Time.now end @format = format @variant = variant @compile_mutex = Mutex.new end