Class: ActionView::AbstractRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/action_view/renderer/abstract_renderer.rb

Overview

This class defines the interface for a renderer. Each class that subclasses AbstractRenderer is used by the base Renderer class to render a specific type of object.

The base Renderer class uses its render method to delegate to the renderers. These currently consist of

PartialRenderer - Used for rendering partials
TemplateRenderer - Used for rendering other types of templates
StreamingTemplateRenderer - Used for streaming

Whenever the render method is called on the base Renderer class, a new renderer object of the correct type is created, and the render method on that new object is called in turn. This abstracts the set up and rendering into a separate classes for partials and templates.

Direct Known Subclasses

PartialRenderer, TemplateRenderer

Defined Under Namespace

Modules: ObjectRendering Classes: RenderedCollection, RenderedTemplate

Instance Method Summary collapse

Constructor Details

#initialize(lookup_context) ⇒ AbstractRenderer

Returns a new instance of AbstractRenderer.



24
25
26
# File 'lib/action_view/renderer/abstract_renderer.rb', line 24

def initialize(lookup_context)
  @lookup_context = lookup_context
end

Instance Method Details

#renderObject

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/action_view/renderer/abstract_renderer.rb', line 28

def render
  raise NotImplementedError
end