Sha256: a7576840e9efe44eb1428520f036ee463f0260df9c5482eba820dc46b04ffa46

Contents?: true

Size: 540 Bytes

Versions: 5

Compression:

Stored size: 540 Bytes

Contents

module I18n
  module JS
    module Formatters
      class Base
        def initialize(js_extend: false, namespace: nil, pretty_print: false, prefix: nil)
          @js_extend    = js_extend
          @namespace    = namespace
          @pretty_print = pretty_print
          @prefix = prefix
        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

5 entries across 5 versions & 1 rubygems

Version Path
i18n-js-3.5.1 lib/i18n/js/formatters/base.rb
i18n-js-3.5.0 lib/i18n/js/formatters/base.rb
i18n-js-3.4.2 lib/i18n/js/formatters/base.rb
i18n-js-3.4.1 lib/i18n/js/formatters/base.rb
i18n-js-3.4.0 lib/i18n/js/formatters/base.rb