new(source, identifier, handler, format: nil, variant: nil, locals: nil, virtual_path: nil, updated_at: nil) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

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
Register or log in to add new notes.