Module: Skyline::Rendering::Helpers::ColumnHelper
- Included in:
- Renderer::Helpers
- Defined in:
- lib/skyline/rendering/helpers/column_helper.rb
Instance Method Summary collapse
-
#sections_per_column(page_version) ⇒ Array<Array<Section>>
(also: #page_sections_per_column)
Devides the sections into columns depending on splitter location.
Instance Method Details
#sections_per_column(page_version) ⇒ Array<Array<Section>> Also known as: page_sections_per_column
Devides the sections into columns depending on splitter location
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/skyline/rendering/helpers/column_helper.rb', line 8 def sections_per_column(page_version) sections_per_col ||= [] col = 0 page_version.sections.each do |section| if section.sectionable_type == "Skyline::Sections::SplitterSection" col += 1 else sections_per_col[col] ||= [] sections_per_col[col].push(section) end end sections_per_col end |