Sha256: 324a6638ccbda5aee379b200fd5b9adad2a1d63d0fa2db897fadf56db4fc9887
Contents?: true
Size: 1.28 KB
Versions: 2
Compression:
Stored size: 1.28 KB
Contents
module Locomotive module Steam module Liquid module Drops class Section < ::Liquid::Drop def initialize(section, content) @section = section @content = content if @content.blank? @content = section.definition['default'] || { 'settings' => {}, 'blocks' => [] } end end # FIXME: id acts as the domID to build HTML tags def id @content['id'] end def id=(id) @content['id'] = id end def type @section.type end def settings @content_proxy ||= SectionContentProxy.new( @content['settings'] || {}, @section.definition['settings'] || [] ) end def css_class @section.definition['class'] end def anchor @content['anchor'] || id end def blocks (@content['blocks'] || []).each_with_index.map do |block, index| SectionBlock.new(@section, block, index) end end def editor_setting_data SectionEditorSettingData.new(@section) end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
locomotivecms_steam-1.5.0.rc0 | lib/locomotive/steam/liquid/drops/section.rb |
locomotivecms_steam-1.5.0.beta3 | lib/locomotive/steam/liquid/drops/section.rb |