Flowdock
method

parse

Importance_0
v1_8_7_330 - Show latest stable - 0 notes - Class: SOAP::MIMEMessage::Headers
parse(str) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/soap/mimemessage.rb, line 50
    def parse(str)
      header_cache = nil
      str.each do |line|
        case line
        when /^\A[^\: \t]+:\s*.+$/
          parse_line(header_cache) if header_cache
          header_cache = line.sub(/\r?\n\z/, '')
        when /^\A\s+(.*)$/
          # a continuous line at the beginning line crashes here.
          header_cache << line
        else
          raise RuntimeError.new("unexpected header: #{line.inspect}")
        end
      end
      parse_line(header_cache) if header_cache
      self
    end
Register or log in to add new notes.