Deeply converts the Structure into a hash.  Structure members that
 are `nil` are omitted from the resultant hash.

 You can call #orig_to_h to get vanilla #to_h behavior as defined
 in stdlib Struct.

 @return [Hash]
504156
def to_h(obj = self)
      case obj
      when Struct
        obj.members.each.with_object({}) do |member, hash|
          value = obj[member]
          hash[member] = to_hash(value) unless value.nil?
        end
      when Hash
        obj.each.with_object({}) do |(key, value), hash|
          hash[key] = to_hash(value)
        end
      when Array
        obj.collect { |value| to_hash(value) }
      else
        obj
      end
    end
1132984
def to_hash
      instance_variables.each_with_object({}) do |var, h|
        h[var[1..-1].to_sym] = instance_variable_get(var)
      end
    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
329760
def to_hash(args = {}) # :nodoc:
      args ||= {}

      if args[:nested]
        {'url' => self[:@url] || self[:url]}
      else
        hash = super
        hash.merge!('@version' => self['@version']) unless new_record?
        {self.class.json_name => hash}
      end
    end
1190274
def to_hash
      ret = {}
      self.each_pair do |k, v|
        ret[k] = v.to_hash()
      end
      ret
    end
1372700
def to_hash
      h = {:width => width, :height => height, :bits => bits, :comment => comment}
      h.merge!(exif) if exif?
      h
    end
1170958
def to_hash
      characteristics.inject({}) do |memo, (k, v)|
        memo[k] = v.value
        memo
      end
    end
787059
def to_hash
      index_hash = Hash.new
      self.each do |space|
        index_hash[space.wiki_name] = space.to_s
      end
      index_hash
    end
1231331
def to_hash
      stringified_params = Hash[parameters.map { |key, val| [key.to_s, val] }]
      base_hash.merge(stringified_params)
    end
753854
def to_h
      @raw.reduce(Hash.new(0)) do |acc, elem|
        acc.merge(elem.date => elem.score)
      end
    end
593834
def to_hash
      hash = {}

      instance_variables.each do |v|
        hash[v.to_s[1..-1].to_sym] = instance_variable_get(v)
      end

      hash[:results].each do |c|
        hash[:results][hash[:results].index(c)] = c.to_hash
      end

      hash
    end
1256900
def array_to_hash(array)
      case array
        when self.class
          array.to_hash
        when Array
          array.map { |element| array_to_hash(element) }
        else
          array
      end
    end
1358218
def to_h

      p = HashParse.new
      t = HashTransform.new

      h_str = self.clone
      h_str.strip!
      t.apply(p.parse(self.strip))

    end
614320
def result_to_hash(result)
      result.children.inject({}) do |hash, node|
        hash[node.name] = node.text
        hash[node.name] = node.text.to_i if node.text && node.text =~ /^\d+$/
        hash
      end
    end
674281
def hash(self):
        '''
        
        '''
        if self._hash is None:
            self._initialize()
            self._hash = khash(type(self).__name__, self._default_value, self._fuzzable)
        return self._hash
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
571271
def apply_nested_hash(hash)
      hash.each do |k, v|
        if v.is_a? Hash
          internal_get(k.to_sym).apply_nested_hash(v)
        else
          internal_set(k.to_sym, v)
        end
      end
    end