Class: ActionView::ObjectRenderer

Inherits:
PartialRenderer show all
Includes:
ObjectRendering
Defined in:
lib/action_view/renderer/object_renderer.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from PartialRenderer

#render

Methods inherited from AbstractRenderer

#render

Constructor Details

#initialize(lookup_context, options) ⇒ ObjectRenderer

Returns a new instance of ObjectRenderer.



7
8
9
10
11
# File 'lib/action_view/renderer/object_renderer.rb', line 7

def initialize(lookup_context, options)
  super
  @object     = nil
  @local_name = nil
end

Instance Method Details

#render_object_derive_partial(object, context, block) ⇒ Object



19
20
21
22
# File 'lib/action_view/renderer/object_renderer.rb', line 19

def render_object_derive_partial(object, context, block)
  path = partial_path(object, context)
  render_object_with_partial(object, path, context, block)
end

#render_object_with_partial(object, partial, context, block) ⇒ Object



13
14
15
16
17
# File 'lib/action_view/renderer/object_renderer.rb', line 13

def render_object_with_partial(object, partial, context, block)
  @object     = object
  @local_name = local_variable(partial)
  render(partial, context, block)
end