This method is called to convert a ClassKit object into a Hash.
426990
def to_hash(object, use_alias = false)
      return object.map { |i| to_hash(i, use_alias) } if object.is_a?(Array)

      validate_class_kit(object.class)

      hash = {}

      attributes = @attribute_helper.get_attributes(object.class)
      attributes.each do |attribute|
        key = use_alias ? (attribute[:alias] || attribute[:name]) : attribute[:name]
        type = attribute[:type]
        value = object.public_send(attribute[:name])
        if value != nil
          hash[key] = if is_class_kit?(type)
                        to_hash(value, use_alias)
                      elsif type == Array
                        value.map do |i|
                          if is_class_kit?(i.class)
                            to_hash(i, use_alias)
                          else
                            i
                          end
                        end
                      else
                        value
                      end
        end
      end
      @hash_helper.indifferent!(hash)
      hash
    end
1252781
def to_hash
      result = ::Hash.new

      @table.each do |key, value|
        if value.is_a? Settings
          value = value.to_hash
        end

        result[key] = value
      end

      result
    end
1020721
function hashObject (obj) {
  if (!isObject(obj)) return null;
  return shortHash(JSON.stringify(sortKeys(obj, { deep: true })));
}
118845
def to_hash
      index_hash = Hash.new
      index_hash["json_claz"] = self.class.name
      index_hash["id"] = id
      index_hash["account_id"] = account_id
      index_hash["cat_id"] = cat_id
      index_hash["name"] = name
      index_hash["cattype"] = cattype
      index_hash["action"] = action
      index_hash["category"] = category
      index_hash["created_at"] = created_at
      index_hash
    end
1095318
def to_json_hash
      result = {}

      @values.each_key do |field_name|
        value = self[field_name]
        field = self.class.get_field(field_name, true)

        # NB: to_json_hash_value should come before json_encode so as to handle
        # repeated fields without extra logic.
        hashed_value = if value.respond_to?(:to_json_hash_value)
                         value.to_json_hash_value
                       elsif field.respond_to?(:json_encode)
                         field.json_encode(value)
                       else
                         value
                       end

        result[field.name] = hashed_value
      end

      result
    end
1044757
def _to_hash(value)
      if value.is_a?(Array)
        value.compact.map{ |v| _to_hash(v) }
      elsif value.is_a?(Hash)
        {}.tap do |hash|
          value.each { |k, v| hash[k] = _to_hash(v) }
        end
      elsif value.respond_to? :to_hash
        value.to_hash
      else
        value
      end
    end
1098590
def convert(jkf)
      jkf = jkf.is_a?(Hash) ? jkf : JSON.parse(jkf)
      convert_root(jkf)
    end
1212353
def prepare_string_for_hashing(obj, ignore_string_type_changes=False, ignore_string_case=False):
    
    original_type = obj.__class__.__name__
    if isinstance(obj, bytes):
        obj = obj.decode('utf-8')
    if not ignore_string_type_changes:
        obj = KEY_TO_VAL_STR.format(original_type, obj)
    if ignore_string_case:
        obj = obj.lower()
    return obj
968855
def convert_to_hash(data)
      data.map do |item|
        item[:key].split('/').reverse.reduce(item[:value]) { |h, v| { v => h } }
      end.reduce(:deep_merge)
    end
336738
def process_hash(value)
      result = {}
      unless value.empty?
        value.split(",").each do |s|
          k,v = s.split(':').compact.map { |i| i.to_s.strip }
          result[k] = v.to_s
        end
      end
      result
    end
1237535
def to_hash
      hash = {}
      ATTRS.each do |attribute|
        hash[attribute] = self.send(attribute)
      end

      hash
    end
1328576
def to_hash
      {}.tap { |h|
        model_class.filterrific_available_filters.each do |filter_name|
          param_value = self.send(filter_name)
          case
          when param_value.blank?
            # do nothing
          when param_value.is_a?(Proc)
            # evaluate Proc so it can be serialized
            h[filter_name] = param_value.call
          when param_value.is_a?(OpenStruct)
            # convert OpenStruct to hash
            h[filter_name] = param_value.marshal_dump
          else
            h[filter_name] = param_value
          end
        end
      }
    end
1325717
def to_hash(arr)
      arr.map(&:flatten).map { |p| { 'key' => p.first.to_s, 'value' => p.last.to_s } }
    end
1213887
def to_hash
            index_hash = Hash.new
            index_hash["json_claz"] = self.class.name
            index_hash["id"] = id
            index_hash["account_id"] = account_id
            index_hash["asm_id"] = asm_id
            index_hash["org_id"] = org_id
            index_hash["tosca_type"] = tosca_type
            index_hash["inputs"] = inputs
            index_hash["outputs"] = outputs
            index_hash["name"] = name
            index_hash["status"] = status
            index_hash["disk_id"] = disk_id
            index_hash["snap_id"] = snap_id
            index_hash["created_at"] = created_at
            index_hash["updated_at"] = updated_at
            index_hash["some_msg"] = some_msg
            index_hash
        end
634372
def to_hash()
      ret_hash = {}
      self.class.json_attributes.each do |attrib|
        ret_hash[attrib] = self.send(attrib.to_s.underscore)
      end
      return ret_hash
    end
691504
def to_output_hash
      HASH_SCHEMA.schema(
        map { |attr| [attr.key, attr.to_read_type] }.to_h
      )
    end
75148
def to_hash
            index_hash = Hash.new
            index_hash["json_claz"] = self.class.name
            index_hash["account_id"] = account_id
            index_hash["marketplace_id"] = marketplace_id
            index_hash["event_type"] = event_type
            index_hash["data"] = data
            index_hash["limit"] = limit
            index_hash["created_at"] = created_at
            index_hash["id"] = id
            index_hash["some_msg"] = some_msg
            index_hash
        end