Class: Hermitage::RailsRenderCore
- Inherits:
-
Object
- Object
- Hermitage::RailsRenderCore
- Defined in:
- lib/hermitage/rails_render_core.rb
Overview
This class performs all the rendering logic for Rails apps
Instance Method Summary collapse
-
#initialize(objects, options = {}) ⇒ RailsRenderCore
constructor
A new instance of RailsRenderCore.
-
#render ⇒ Object
Renders gallery markup.
Constructor Details
#initialize(objects, options = {}) ⇒ RailsRenderCore
Returns a new instance of RailsRenderCore.
6 7 8 9 10 |
# File 'lib/hermitage/rails_render_core.rb', line 6 def initialize(objects, = {}) @objects = objects @options = Configurator.(objects, ) @template = ActionView::Base.new end |
Instance Method Details
#render ⇒ Object
Renders gallery markup
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/hermitage/rails_render_core.rb', line 13 def render # Initialize the resulting tag tag = '' # Slice objects into separate lists lists = slice_objects # Render each list into `tag` variable lists.each do |list| items = list.collect { |item| render_link_for(item) } tag << render_content_tag_for(items) end tag.html_safe end |