Sha256: 1e6a94c7c885d9231e6bc4cd184fcea616aa6f7f457a2e30b6ad9922378a28e9

Contents?: true

Size: 821 Bytes

Versions: 29

Compression:

Stored size: 821 Bytes

Contents

module Locomotive
  module Wagon

    class SnippetDecorator < Locomotive::Steam::Decorators::TemplateDecorator

      include ToHashConcern
      include PersistAssetsConcern

      attr_accessor :__content_assets_pusher__

      def initialize(object, locale = nil, content_assets_pusher)
        self.__content_assets_pusher__ = content_assets_pusher
        super(object, locale, nil)
      end

      def __attributes__
        %i(name slug template)
      end

      def id
        slug
      end

      def template
        {}.tap do |translations|
          __getobj__.template_path.translations.each do |locale, _|
            __with_locale__(locale) do
              translations[locale] = replace_with_content_assets!(self.liquid_source)
            end
          end
        end
      end

    end

  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
locomotivecms_wagon-2.2.0.rc2 lib/locomotive/wagon/decorators/snippet_decorator.rb
locomotivecms_wagon-2.2.0.rc1 lib/locomotive/wagon/decorators/snippet_decorator.rb
locomotivecms_wagon-2.2.0.beta1 lib/locomotive/wagon/decorators/snippet_decorator.rb
locomotivecms_wagon-2.1.1 lib/locomotive/wagon/decorators/snippet_decorator.rb
locomotivecms_wagon-2.1.0 lib/locomotive/wagon/decorators/snippet_decorator.rb
locomotivecms_wagon-2.1.0.rc5 lib/locomotive/wagon/decorators/snippet_decorator.rb
locomotivecms_wagon-2.1.0.rc4 lib/locomotive/wagon/decorators/snippet_decorator.rb
locomotivecms_wagon-2.1.0.rc3 lib/locomotive/wagon/decorators/snippet_decorator.rb
locomotivecms_wagon-2.0.1 lib/locomotive/wagon/decorators/snippet_decorator.rb