method

load

Importance_0
v1_8_7_72 - Show latest stable - 0 notes - Class: SOAP::Property
load(stream) public

No documentation

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

Hide source
# File lib/soap/property.rb, line 71
  def load(stream)
    key_prefix = ""
    stream.each_with_index do |line, lineno|
      line.sub!(/\r?\n\z/, '')
      case line
      when COMMENT_REGEXP
        next
      when CATDEF_REGEXP
        key_prefix = $1.strip
      when LINE_REGEXP
        key, value = $1.strip, $2.strip
        key = "#{key_prefix}.#{key}" unless key_prefix.empty?
        key, value = loadstr(key), loadstr(value)
        self[key] = value
      else
        raise TypeError.new(
          "property format error at line #{lineno + 1}: `#{line}'")
      end
    end
    self
  end
Register or log in to add new notes.