Sha256: 759073f47a151d79ce05095d1399bd610f8765dbc82c866238da2c2138171f01

Contents?: true

Size: 625 Bytes

Versions: 3

Compression:

Stored size: 625 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.is_a?(EnrichedString)
              first
            else
              merged_strings = dup
              result = join_without_rich_i18n(sep)
              result.merged_strings = merged_strings
              result
            end
          end
        
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rich_i18n-1.2.3 lib/rich/i18n/core/array/merging.rb
rich_i18n-1.2.2 lib/rich/i18n/core/array/merging.rb
rich_i18n-1.2.1 lib/rich/i18n/core/array/merging.rb