Class: ActionView::AbstractRenderer::RenderedCollection

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

Overview

:nodoc:

Defined Under Namespace

Classes: EmptyCollection

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rendered_templates, spacer) ⇒ RenderedCollection

Returns a new instance of RenderedCollection.



117
118
119
120
# File 'actionview/lib/action_view/renderer/abstract_renderer.rb', line 117

def initialize(rendered_templates, spacer)
  @rendered_templates = rendered_templates
  @spacer = spacer
end

Instance Attribute Details

#rendered_templatesObject (readonly)

Returns the value of attribute rendered_templates



115
116
117
# File 'actionview/lib/action_view/renderer/abstract_renderer.rb', line 115

def rendered_templates
  @rendered_templates
end

Class Method Details

.empty(format) ⇒ Object



111
112
113
# File 'actionview/lib/action_view/renderer/abstract_renderer.rb', line 111

def self.empty(format)
  EmptyCollection.new format
end

Instance Method Details

#bodyObject



122
123
124
# File 'actionview/lib/action_view/renderer/abstract_renderer.rb', line 122

def body
  @rendered_templates.map(&:body).join(@spacer.body).html_safe
end

#formatObject



126
127
128
# File 'actionview/lib/action_view/renderer/abstract_renderer.rb', line 126

def format
  rendered_templates.first.format
end