method
load
v1_8_6_287 -
Show latest stable
- Class:
SOAP::Property
load(stream)public
No documentation available.
# 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