lib/gooddata/helpers/global_helpers_params.rb
def encode_params(params, data_key)
        res = {}
        nested = {}
        core_types = [FalseClass, Integer, Float, NilClass, TrueClass, String]
        params.each do |k, v|
          if core_types.include?(v.class)
            res[k] = v
          else
            nested[k] = v
          end
        end
        res[data_key] = nested.to_json unless nested.empty?
        res
      end
# Encodes parameters for passing them to GD execution platform.
# Core types are kept and complex types (arrays, structures, etc) are
# JSON encoded into key hash "gd_encoded_params" or
# "gd_encoded_hidden_params", depending on the 'hidden' method param.
# The two different keys are used because the params and hidden params
# are merged by the platform and if we use the same key,
# the param would be overwritten.
#
# Core types are following:
# - Boolean (true, false)
# - Fixnum
# - Float
# - Nil
# - String
#
# @param [Hash] params Parameters to be encoded
# @return [Hash] Encoded parameters
Encodes parameters for passing them to GD execution platform.
Core types are kept and complex types (arrays, structures, etc) are
JSON encoded into key hash "gd_encoded_params" or
"gd_encoded_hidden_params", depending on the 'hidden' method param.
The two different keys are used because the params and hidden params
are merged by the platform and if we use the same key,
the param would be overwritten.

Core types are following:
Boolean (true, false)
Fixnum
Float
Nil
String
Encodes parameters for passing them to GD execution platform . Core types are kept and complex types ( arrays structures etc ) are JSON encoded into key hash " gd_encoded_params " or " gd_encoded_hidden_params " depending on the ' hidden ' method param . The two different keys are used because the params and hidden params are merged by the platform and if we use the same key the param would be overwritten . Core types are following : Boolean ( true false ) Fixnum Float Nil String
def encode_params(params, data_key)
        res = {}
        nested = {}
        core_types = [FalseClass, Integer, Float, NilClass, TrueClass, String]
        params.each do |k, v|
          if core_types.include?(v.class)
            res[k] = v
          else
            nested[k] = v
          end
        end
        res[data_key] = nested.to_json unless nested.empty?
        res
      end
def encode_params ( params , data_key ) res = { } nested = { } core_types = [ FalseClass , Integer , Float , NilClass , TrueClass , String ] params . each do | k , v | if core_types . include? ( v . class ) res [ k ] = v else nested [ k ] = v end end res [ data_key ] = nested . to_json unless nested . empty? res end
Encodes parameters for passing them to GD execution platform.
Encodes parameters for passing them to GD execution platform .
None
Hash
params
data_key
params Parameters to be encoded
params Parameters to be encoded