Class: ActionView::AbstractRenderer
- Defined in:
- actionview/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 setup and rendering into a separate classes for partials and templates.
Direct Known Subclasses
Defined Under Namespace
Classes: RenderedCollection, RenderedTemplate
Instance Method Summary collapse
-
#initialize(lookup_context) ⇒ AbstractRenderer
constructor
A new instance of AbstractRenderer.
- #render ⇒ Object
Constructor Details
#initialize(lookup_context) ⇒ AbstractRenderer
Returns a new instance of AbstractRenderer.
22 23 24 |
# File 'actionview/lib/action_view/renderer/abstract_renderer.rb', line 22 def initialize(lookup_context) @lookup_context = lookup_context end |
Instance Method Details
#render ⇒ Object
26 27 28 |
# File 'actionview/lib/action_view/renderer/abstract_renderer.rb', line 26 def render raise NotImplementedError end |