Sha256: 10c9ab10d49f41a6f9e78647df9ba32ff1de9c7f09150ec3e577838274eeb98f
Contents?: true
Size: 812 Bytes
Versions: 6
Compression:
Stored size: 812 Bytes
Contents
module Skyline::Rendering::Helpers::ColumnHelper # Devides the sections into columns depending on splitter location # # @param page_version [ArticleVersion] The ArticleVersion to get section from to split # # @return [Array<Array<Section>>] An array of columns each containing and array of sections. 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 # @deprecated Will be removed in 3.1 for the more general sections_per_column alias :page_sections_per_column :sections_per_column end
Version data entries
6 entries across 6 versions & 2 rubygems