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 set up and rendering into a separate classes for partials and templates.
Direct Known Subclasses
Defined Under Namespace
Modules: ObjectRendering 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.
24 25 26 |
# File 'actionview/lib/action_view/renderer/abstract_renderer.rb', line 24 def initialize(lookup_context) @lookup_context = lookup_context end |
Instance Method Details
#render ⇒ Object
28 29 30 |
# File 'actionview/lib/action_view/renderer/abstract_renderer.rb', line 28 def render raise NotImplementedError end |