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.


119
120
121
122
# File 'actionview/lib/action_view/renderer/abstract_renderer.rb', line 119

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


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

def rendered_templates
  @rendered_templates
end

Class Method Details

.empty(format) ⇒ Object


113
114
115
# File 'actionview/lib/action_view/renderer/abstract_renderer.rb', line 113

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

Instance Method Details

#bodyObject


124
125
126
# File 'actionview/lib/action_view/renderer/abstract_renderer.rb', line 124

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

#formatObject


128
129
130
# File 'actionview/lib/action_view/renderer/abstract_renderer.rb', line 128

def format
  rendered_templates.first.format
end