Sha256: cf4f6997bf109cb54f6bde26c131bb2faaad0cc0d34162e2109cc7a2985f5d52

Contents?: true

Size: 661 Bytes

Versions: 37

Compression:

Stored size: 661 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

37 entries across 37 versions & 1 rubygems

Version Path
locomotivecms_steam-1.4.1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.4.0 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.4.0.rc2 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.4.0.rc1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.4.0.pre.rc.1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.3.0 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.3.0.rc2 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.1.2 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.2.1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.3.0.rc1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.2.0 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.2.0.rc3 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.2.0.rc2 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.2.0.rc1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.2.0.beta1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.1.1 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.1.0 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.1.0.rc3 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.1.0.rc2 lib/locomotive/steam/services/concerns/decorator.rb
locomotivecms_steam-1.1.0.rc1 lib/locomotive/steam/services/concerns/decorator.rb