Sha256: 67f0b75dcae3be9c799f59809d63085d0b72dbaac6ca334d24644fbe4e370ed2

Contents?: true

Size: 580 Bytes

Versions: 11

Compression:

Stored size: 580 Bytes

Contents

module I18n
  module JS
    module Formatters
      class Base
        def initialize(js_extend: false, namespace: nil, pretty_print: false, prefix: nil, suffix: nil)
          @js_extend    = js_extend
          @namespace    = namespace
          @pretty_print = pretty_print
          @prefix = prefix
          @suffix = suffix
        end

        protected

        def format_json(translations)
          if @pretty_print
            ::JSON.pretty_generate(translations)
          else
            translations.to_json
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
i18n-js-3.9.2 lib/i18n/js/formatters/base.rb
i18n-js-3.9.1 lib/i18n/js/formatters/base.rb
i18n-js-3.9.0 lib/i18n/js/formatters/base.rb
i18n-js-3.8.4 lib/i18n/js/formatters/base.rb
i18n-js-3.8.3 lib/i18n/js/formatters/base.rb
i18n-js-3.8.2 lib/i18n/js/formatters/base.rb
i18n-js-3.8.1 lib/i18n/js/formatters/base.rb
i18n-js-3.8.0 lib/i18n/js/formatters/base.rb
i18n-js-3.7.1 lib/i18n/js/formatters/base.rb
i18n-js-3.7.0 lib/i18n/js/formatters/base.rb
i18n-js-3.6.0 lib/i18n/js/formatters/base.rb