Serialize to hash

 @return [Hash{String => String}]
7012
def to_hash
      hash = {}

      hash['scale'] = "#{scale}x" unless scale.nil?

      (KNOWN_KEYS - [:scale]).each do |key|
        value = self.send(key)
        hash[key.to_s.dasherize] = value.to_s unless value.nil?
      end

      attributes.each do |key, value|
        hash[key.to_s] = value
      end

      hash
    end
1357122
function hash() {
	var i = 0,
		args = arguments,
		length = args.length,
		obj = {};
	for (; i < length; i++) {
		obj[args[i++]] = args[i];
	}
	return obj;
}
979079
def to_hash
      {
        'url'              => url,
        'scheme'           => scheme,
        'host'             => host,
        'root_url'         => root_url,
        'title'            => title,
        'best_title'       => best_title,
        'author'           => author,
        'best_author'      => best_author,
        'description'      => description,
        'best_description' => best_description,
        'links'            => links.to_hash,
        'images'           => images.to_a,
        'charset'          => charset,
        'feed'             => feed,
        'content_type'     => content_type,
        'meta_tags'        => meta_tags,
        'favicon'          => images.favicon,
        'response'         => { 'status'  => response.status,
                                'headers' => response.headers }
      }
    end
56489
def to_input_hash
      HASH_SCHEMA.schema(
        map { |attr| [attr.name, attr.to_write_type] }.to_h
      )
    end
664583
def to_hash
      result = {}

      @values.keys.each do |field_name|
        value = __send__(field_name)
        hashed_value = value.respond_to?(:to_hash_value) ? value.to_hash_value : value
        result.merge!(field_name => hashed_value)
      end

      result
    end
1168899
def to_params_hash(keys,values)
      hash = {}
      keys.size.times { |i| hash[ keys[i].to_sym ] = values[i] }
      hash
    end
1329830
def to_s
      hash = {}
      @events_map.each_pair do |name, trans|
        hash[name] = trans
      end
      hash.to_s
    end
259005
function stringToHash(hashAsString) {
        var entries = {};
        if (hashAsString) {
            var text = decodeURI(hashAsString);
            var items = text.split('&');
            angular.forEach(items, function (item) {
                var kv = item.split('=');
                var key = kv[0];
                var value = kv[1] || key;
                entries[key] = value;
            });
        }
        return entries;
    }
655054
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["disk_id"] = disk_id
            index_hash["size"] = size
            index_hash["status"] = status
            index_hash["created_at"] = created_at
            index_hash["some_msg"] = some_msg
            index_hash
        end
990704
def to_hash
            index_hash = Hash.new
            index_hash["json_claz"] = self.class.name
            index_hash["id"] = id
            index_hash["provider_id"] = provider_id
            index_hash["account_id"] = account_id
            index_hash["provider_name"] = provider_name
            index_hash["options"] = options
            index_hash["created_at"] = created_at
            index_hash
        end
93391
def to_hash
        h = {}
        keys.each { |k| h[ k ] = self.fetch( k ) }
        h
    end
457234
def to_hash
            index_hash = {}
            index_hash['json_claz'] = self.class.name
            index_hash['id'] = id
            index_hash["asms_id"] = asms_id
            index_hash['name'] = name
            index_hash['components'] = components
            index_hash['tosca_type'] = tosca_type
            index_hash['policies'] = policies
            index_hash['inputs'] = inputs
            index_hash['outputs'] = outputs
            index_hash['status'] = status
            index_hash['state'] = state
            index_hash['created_at'] = created_at
            index_hash
        end
727679
def to_hash()
      rethash = {
        "permissions" => @permissions
      }
      (@user.attributes - [:links]).each do |attr_sym|
        rethash[attr_sym.to_s] = @user.send(attr_sym.to_s)
      end
      rethash
    end
479418
def to_hash
      hash = {}
      instance_variables.each do |name|
        value = instance_variable_get(name)
        next if value.nil?
        name = name[1..-1]
        key = self.class.names.key?(name) ? self.class.names[name] : name
        if value.instance_of? Array
          hash[key] = value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
        elsif value.instance_of? Hash
          hash[key] = {}
          value.each do |k, v|
            hash[key][k] = v.is_a?(BaseModel) ? v.to_hash : v
          end
        else
          hash[key] = value.is_a?(BaseModel) ? value.to_hash : value
        end
      end
      hash
    end
221373
def stringify( hash )

            keys = @sorted ? hash.keys.sort : hash.keys
            vals = keys.map{ |key|
                val = ''
                if hash[key].kind_of?( Array ) 
                    val = rotate( hash[key] )
                elsif hash[key].kind_of?( Hash )
                    val = @sorted ? hash[key].keys.sort[0] : hash[key].keys[0]
                else
                    val = hash[key]
                end
                "#{key}: #{val}"
            }
            return vals.join( '; ' ) + (vals.length ? ';' : '')

        end
843242
def str_to_hash
        client = RestClient.where(:api_key => @http_headers[@@header_api_key]).first
        if client.nil?
          @errors << "client is not registered"
        end
        client.nil? ? "" : client.secret + @request_uri.gsub( /\?.*/, "" ) + @http_headers[@@header_timestamp]
      end
725201
def to_hash
      {}.merge(@properties).tap do |h|
        h['_links'] = {}.merge @links    unless @links.empty?

        combined_embedded = {}
        combined_embedded.merge! @embedded unless @embedded.empty?
        combined_embedded.merge! @embedded_arrays unless @embedded_arrays.empty?
        h['_embedded'] = combined_embedded unless combined_embedded.empty?
      end
    end