Merge all the texts of an element into the hash

 hash::
   Hash to add the converted element to.
 element::
   XML element whose texts are to me merged into the hash
502425
def merge_texts!(hash, element)
        unless element.has_text?
          hash
        else
          # must use value to prevent double-escaping
          texts = +""
          element.texts.each { |t| texts << t.value }
          merge!(hash, CONTENT_KEY, texts)
        end
      end
170895
def add_element name, value = nil
      value = value.respond_to?(:xmlschema) ? value.xmlschema : value.to_s
      XML.new super(name, value)
    end
594692
def merge_element!(hash, element, depth)
        raise "Document too deep!" if depth == 0
        delete_empty(hash)
        merge!(hash, element.tag_name, collapse(element, depth))
      end
481182
def merge!(hash)
      hash.each do |key, value|
        if config_contexts.key?(key)
          # Grab the config context and let internal_get cache it if so desired
          config_contexts[key].restore(value)
        else
          configuration[key] = value
        end
      end
      self
    end
927269
def new
      hash = {}

      if step = Step.find_by_id(params["step_id"])
        hash[:container] = step
      elsif element = RiddlerAdmin::Element.find_by_id(params[:element_id])
        hash[:container] = element
      end

      @element = @element_class.new hash
    end
1289887
def to_xml(params = {})
      params[:fields] ||= []
      params.reverse_merge!(:name => self.class.tag_name, :namespace => self.class.roxml_namespace)
      params[:namespace] = nil if ['*', 'xmlns'].include?(params[:namespace])
      node = XML.new_node([params[:namespace], params[:name]].compact.join(':')).tap do |root|
        refs = (self.roxml_references.present? \
          ? self.roxml_references \
          : self.class.roxml_attrs.map {|attr| attr.to_ref(self) })

        if params[:fields].length > 0
          refs.reject! { |r| !params[:fields].include?(r.name) }
        end
        refs.each do |ref|
          value = ref.to_xml(self)
          unless value.nil?
            ref.update_xml(root, value)
          end
        end
      end
    end
437945
def deep_merge!(other_hash)
      other_hash.each_pair do |k,v|
        tv = self[k]
        self[k] = tv.is_a?(Hash) && v.is_a?(Hash) ? self.class.new(tv).deep_merge(v) : v
      end
      self
    end
1098356
public int addElement(int element, int hash) {
		int bit_bucket = hash % (m_bit_filter.length << 5);
		m_bit_filter[(bit_bucket >> 5)] |= (1 << (bit_bucket & 0x1F));
		int bucket = hash % m_hashBuckets.size();
		int list = m_hashBuckets.get(bucket);
		if (list == -1) {
			list = m_lists.createList();
			m_hashBuckets.set(bucket, list);
		}
		int node = m_lists.addElement(list, element);
		return node;
	}
89824
def initialize_copy(other)
      @options = other.options.dup
      @errors = other.errors.dup
      @data, @strings = [], {}
      @entries = Hash.new { |h,k| h.fetch(k.to_s, nil) }

      other.each do |element|
        add element.dup
      end

      self
    end
676708
def hash_to_rxf_node(hash , level , ref)
      node = RxFile::HashNode.new(ref)
      hash.each do |key , object|
        k = to_rxf_node( key ,level + 1)
        v = to_rxf_node( object ,level + 1)
        node.add(k , v)
      end
      node
    end
1102277
def after_hash(node)
      builder = DefinitionBuilder::RubyHash.new(
        node,
        self,
        :values => value_stack.pop
      )

      push_value(builder.build)
    end
1340141
def merge_contiguous(C, node, xpath, namespaces=None):
        
        new_node = deepcopy(node)
        elems = XML.xpath(new_node, xpath, namespaces=namespaces)
        elems.reverse()
        for elem in elems:
            nxt = elem.getnext()
            if elem.attrib == {}:
                XML.replace_with_contents(elem)
            elif (
                elem.tail in [None, '']
                and nxt is not None
                and elem.tag == nxt.tag
                and elem.attrib == nxt.attrib
            ):
                # merge nxt with elem
                # -- append nxt.text to elem last child tail
                if len(elem.getchildren()) > 0:
                    lastch = elem.getchildren()[-1]
                    lastch.tail = (lastch.tail or '') + (nxt.text or '')
                else:
                    elem.text = (elem.text or '') + (nxt.text or '')
                # -- append nxt children to elem children
                for ch in nxt.getchildren():
                    elem.append(ch)
                # -- remove nxt
                XML.remove(nxt, leave_tail=True)
        return new_node
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
306611
def sms(*args)
      message = ''
      options = {}
      args.each do |arg|
        case arg
        when String
          message = arg
        when Hash
          options.merge!(arg)
        else
          raise ArgumentError, 'sms expects STring or Hash argument'
        end
      end

      output { @xml.Sms(message, options) }
    end
707050
def to_hash
      @data.inject({}) do |ac,(k,v)|
        ac.merge! k => ((v.kind_of? self.class) ? v.to_hash : v)
      end
    end
1054915
def xml_to_hash(element, child_with_children = "", unique_children = true)
      properties = {}
      element.each_element_with_text do |e|
        if e.name.eql?(child_with_children)
          if unique_children
            e.each_element_with_text do |t|
              properties[t.name] = to_type(t.text)
            end
          else
            children = []
            e.each_element_with_text do |t|
              properties[t.name] = children.push(to_type(t.text))
            end
          end
        else
          properties[e.name] = to_type(e.text)
        end
      end
      properties
    end
1190097
def parse_element(ele)
      if ele.is_a? Nokogiri::XML::Text
        return "#{ele.text}\n"
      else
        if (children = ele.children).count > 0
          return wrap_node(ele,children.map {|ele| parse_element(ele)}.join )
        else
          return wrap_node(ele,ele.text)
        end
      end
    end