class Locomotive::Wagon::SnippetDecorator

Attributes

__content_assets_pusher__[RW]

Public Class Methods

new(object, locale = nil, content_assets_pusher) click to toggle source
Calls superclass method
# File lib/locomotive/wagon/decorators/snippet_decorator.rb, line 11
def initialize(object, locale = nil, content_assets_pusher)
  self.__content_assets_pusher__ = content_assets_pusher
  super(object, locale, nil)
end

Public Instance Methods

__attributes__() click to toggle source
# File lib/locomotive/wagon/decorators/snippet_decorator.rb, line 16
def __attributes__
  %i(name slug template)
end
id() click to toggle source
# File lib/locomotive/wagon/decorators/snippet_decorator.rb, line 20
def id
  slug
end
template() click to toggle source
# File lib/locomotive/wagon/decorators/snippet_decorator.rb, line 24
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