Sha256: f6d5963c7ddab040f5c5b68a273bdd362cf8df7b10c508dd5258cb87fad77b83

Contents?: true

Size: 560 Bytes

Versions: 5

Compression:

Stored size: 560 Bytes

Contents

module Rich
  module I18n
    module Core
      module Array
        module Merging

          def self.included(base)
            base.class_eval do
              alias_method_chain :join, :rich_i18n
            end
          end

          def join_with_rich_i18n(sep = $,)
            if size == 1 && first.enriched?
              first
            else
              result = join_without_rich_i18n(sep)
              any?(&:enriched?) ? EnrichedString.new(result, nil, dup) : result
            end
          end

        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rich_i18n-1.3.4 lib/rich/i18n/core/array/merging.rb
rich_i18n-1.3.3 lib/rich/i18n/core/array/merging.rb
rich_i18n-1.3.2 lib/rich/i18n/core/array/merging.rb
rich_i18n-1.3.1 lib/rich/i18n/core/array/merging.rb
rich_i18n-1.3.0 lib/rich/i18n/core/array/merging.rb