Sha256: e687d26f46100f6f8227209d2fcc55c24ac25105dd74e1f56a91404d9becc6d0

Contents?: true

Size: 659 Bytes

Versions: 17

Compression:

Stored size: 659 Bytes

Contents

module Locomotive
  module Steam
    module Services
      module Concerns

        module Decorator

          private

          def decorate(klass = Decorators::TemplateDecorator, &block)
            if (object = yield).blank?
              object
            else
              klass.decorate(object, locale, default_locale)
            end
          end

          def i18n_decorate(&block)
            decorate(Decorators::I18nDecorator, &block)
          end

          def locale
            repository.locale
          end

          def default_locale
            repository.site.default_locale
          end
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
locomotivecms_steam-1.8.0.alpha2 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.8.0.alpha1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.7.1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.7.0 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.6.1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.6.0 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.6.0.rc1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.6.0.beta1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.5.3 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.5.2 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.5.1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.5.0 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.5.0.rc1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.5.0.rc0 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.5.0.beta3 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.5.0.beta2 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.5.0.beta1 lib/locomotive/steam/services/concerns/decorator.rb