Class: ActionView::AbstractRenderer::RenderedCollection

Inherits:
Object
  • Object
show all
Defined in:
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.



37
38
39
40
# File 'lib/action_view/renderer/abstract_renderer.rb', line 37

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.



35
36
37
# File 'lib/action_view/renderer/abstract_renderer.rb', line 35

def rendered_templates
  @rendered_templates
end

Class Method Details

.empty(format) ⇒ Object



31
32
33
# File 'lib/action_view/renderer/abstract_renderer.rb', line 31

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

Instance Method Details

#bodyObject



42
43
44
# File 'lib/action_view/renderer/abstract_renderer.rb', line 42

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

#formatObject



46
47
48
# File 'lib/action_view/renderer/abstract_renderer.rb', line 46

def format
  rendered_templates.first.format
end