Sha256: 8fcacdf517bf8fea1a91d9e4ce85b79cfd2523a54f81c951c422646d32b50963

Contents?: true

Size: 550 Bytes

Versions: 41

Compression:

Stored size: 550 Bytes

Contents

# frozen_string_literal: true

require 'json'

module I18n::Tasks
  module Data
    module Adapter
      module JsonAdapter
        class << self
          # @return [Hash] locale tree
          def parse(str, opts)
            JSON.parse(str, parse_opts(opts))
          end

          # @return [String]
          def dump(tree, opts)
            JSON.generate(tree, parse_opts(opts))
          end

          private

          def parse_opts(opts)
            opts.try(:symbolize_keys) || {}
          end
        end
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 3 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/i18n-tasks-1.0.14/lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-1.0.13 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-1.0.12 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-1.0.11 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-1.0.10 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-1.0.9 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-1.0.8 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-1.0.7 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-1.0.6 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-1.0.5 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-1.0.4 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-1.0.3 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-1.0.2 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-1.0.1 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-1.0.0 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-youdao-tasks-0.9.37 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-0.9.37 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-0.9.36 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-0.9.35 lib/i18n/tasks/data/adapter/json_adapter.rb
i18n-tasks-0.9.34 lib/i18n/tasks/data/adapter/json_adapter.rb