:call-seq:
   metric.to_hash -> Hash

 Convert the metric to a hash
557032
def to_hash
      h = super
      h['timed_stats'] = @timed_stats.to_hash
      h['value_stats'] = @value_stats.to_hash( Stats::STATS - %w[ rate ] )
      h['rate'] = self.rate
      h['unit_count'] = self.unit_count
      return h
    end
288115
def to_hash
    self.instance_variables.inject({}) { |m,v| m[v[1,v.length].to_sym] = instance_variable_get(v); m }
  end
1325717
def to_hash(arr)
      arr.map(&:flatten).map { |p| { 'key' => p.first.to_s, 'value' => p.last.to_s } }
    end
604719
def hash(self, *args, **kwargs):
        
        joiner = kwargs.get('joiner', '').encode('utf-8')
        as_bytes = kwargs.get('as_bytes', False)

        def conv(arg):
            if isinstance(arg, integer_types):
                arg = int_to_bytes(arg)

            if PY3:
                if isinstance(arg, str):
                    arg = arg.encode('utf-8')
                return arg

            return str(arg)

        digest = joiner.join(map(conv, args))

        hash_obj = self._hash_func(digest)

        if as_bytes:
            return hash_obj.digest()

        return int_from_hex(hash_obj.hexdigest())
451313
def hash(self):
        '''
        
        '''
        hashed = super(Repeat, self).hash()
        return khash(hashed, self._min_times, self._max_times, self._step, self._repeats)
124743
def to_hash
      _new_hash= {}
      each do |key, value|
        _new_hash[convert_key(key)] = convert_value(value, for: :to_hash)
      end
      Hash.new(default).merge!(_new_hash)
    end
1342537
def to_a
      hash = {}
      @to_a ||=
        elements_with_tags.map.with_index do |(el, tag_name), idx|
          selector = @selector.dup
          selector[:index] = idx unless idx.zero?
          element = element_class.new(@query_scope, selector)
          if [HTMLElement, Input].include? element.class
            construct_subtype(element, hash, tag_name).tap { |e| e.cache = el }
          else
            element.tap { |e| e.cache = el }
          end
        end
    end
142102
def to_hash
      hash = {}
      each_pair do |key, value|
        if value.kind_of?(ConfigHash)
          value = value.to_hash
        end
        
        hash[key] = value
      end
      hash
    end
90150
def return_hash(final_vector)
      case digest_length
      when 512
        create_digest(final_vector)
      when 256
        create_digest(vector_from_array(final_vector[0..31]))
      else
        raise ArgumentError,
              "digest length must be equal to 256 or 512, not #{digest_length}"
      end
    end
1129591
def to_hash(obj=nil, methods:[], recursive: false, check: false, compact: false)
			return {} if obj.nil?
			obj||=self
			stack=[*obj]
			processed=[]
			klass=stack.first.class
			h={}
			while !stack.empty?
				obj=stack.shift
				next if processed.include?(obj)
				processed << obj
				attributes={}
				methods.each do |m|
					next if check and !obj.respond_to? m
					v=obj.public_send(m)
					attributes[m]=v
					if recursive
						vals=v.kind_of?(Enumerable) ? v.to_a.flatten : [v]
						vals.select! {|v| v.kind_of?(klass)}
						stack.concat(vals)
					end
				end
				attributes=attributes.values.first if compact and attributes.keys.length == 1
				h[obj]=attributes
			end
			h
		end
110836
def to_hash(node)
      node_type = get_node_type node

      case node_type
      when :blank
        {}
      when :branch
        hash = {}

        16.times do |i|
          sub_hash = to_hash decode_to_node(node[i])
          sub_hash.each {|k, v| hash[NibbleKey.new([i]) + k] = v }
        end

        hash[NibbleKey.terminator] = node.last if node.last.true?
        hash
      when *NODE_KV_TYPE
        nibbles = NibbleKey.decode(node[0]).terminate(false)

        sub_hash = node_type == :extension ?
          to_hash(decode_to_node(node[1])) : {NibbleKey.terminator => node[1]}

        {}.tap do |hash|
          sub_hash.each {|k, v| hash[nibbles + k] = v }
        end
      else
        # do nothing
      end
    end
755518
def hash(self):
        '''
        
        '''
        hashed = super(Pad, self).hash()
        return khash(hashed, self._pad_length, self._pad_data)
102006
def to_hash
      {
        :repository   => repository.name,
        :model        => model.name,
        :fields       => fields,
        :links        => links,
        :conditions   => conditions,
        :offset       => offset,
        :limit        => limit,
        :order        => order,
        :unique       => unique?,
        :add_reversed => add_reversed?,
        :reload       => reload?,
      }
    end
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
1339511
def to_hash
      VALID_ATTRIBUTES.reduce({}) { |acc, k| acc[k] = send(k); acc }
    end
413570
def to_hash
      {
        response_id: response_id,
        question_id: question_id,
        option_id: option_id,
        question_pipe: question_pipe,
        submitted_at: submitted_at,
        survey_id: survey_id,
        other_text: other_text,
        answer_text: option_id || other_text ? nil : answer_text
      }.reject { |k, v| v.nil? }
    end
1178109
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["credit"] = credit
            index_hash["biller_credit"] = biller_credit
            index_hash["created_at"] = created_at
            index_hash["updated_at"] = updated_at
            index_hash
        end