Sha256: 4ba021b9c71de7ec0611d6688b40d41882348b0e942c7e03d0ed255744bbdfdf

Contents?: true

Size: 817 Bytes

Versions: 15

Compression:

Stored size: 817 Bytes

Contents

module Fluent
  module BigQuery
    module Helper
      class << self
        def deep_symbolize_keys(object)
          case object
          when Hash
            object.each_with_object({}) do |(key, value), result|
              result[key.to_sym] = deep_symbolize_keys(value)
            end
          when Array
            object.map {|e| deep_symbolize_keys(e) }
          else
            object
          end
        end

        def deep_stringify_keys(object)
          case object
          when Hash
            object.each_with_object({}) do |(key, value), result|
              result[key.to_s] = deep_stringify_keys(value)
            end
          when Array
            object.map {|e| deep_stringify_keys(e) }
          else
            object
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
fluent-plugin-bigquery-3.3.0 lib/fluent/plugin/bigquery/helper.rb
fluent-plugin-bigquery-3.2.0 lib/fluent/plugin/bigquery/helper.rb
fluent-plugin-bigquery-3.1.0 lib/fluent/plugin/bigquery/helper.rb
fluent-plugin-bigquery-3.0.1 lib/fluent/plugin/bigquery/helper.rb
fluent-plugin-bigquery-3.0.0 lib/fluent/plugin/bigquery/helper.rb
fluent-plugin-bigquery-2.3.0 lib/fluent/plugin/bigquery/helper.rb
fluent-plugin-bigquery-test-2.2.0 lib/fluent/plugin/bigquery/helper.rb
fluent-plugin-bigquery-2.2.0 lib/fluent/plugin/bigquery/helper.rb
fluent-plugin-bigquery-2.1.0 lib/fluent/plugin/bigquery/helper.rb
fluent-plugin-bigquery-2.0.0 lib/fluent/plugin/bigquery/helper.rb
fluent-plugin-bigquery-2.0.0.beta lib/fluent/plugin/bigquery/helper.rb
fluent-plugin-bigquery-1.2.0 lib/fluent/plugin/bigquery/helper.rb
fluent-plugin-bigquery-1.1.1 lib/fluent/plugin/bigquery/helper.rb
fluent-plugin-bigquery-1.1.0 lib/fluent/plugin/bigquery/helper.rb
fluent-plugin-bigquery-1.0.0 lib/fluent/plugin/bigquery/helper.rb